Skip to content

Commit

Permalink
fix parsing of --issue-url and -i options (#138)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbwharris authored and cookpete committed Oct 29, 2019
1 parent 781955f commit 5041b3e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async function getOptions (argv) {
.option('-l, --commit-limit <count>', `number of commits to display per release, default: ${DEFAULT_OPTIONS.commitLimit}`, parseLimit)
.option('-b, --backfill-limit <count>', `number of commits to backfill empty releases with, default: ${DEFAULT_OPTIONS.backfillLimit}`, parseLimit)
.option('--commit-url <url>', 'override url for commits, use {id} for commit id')
.option('--issue-url, -i <url>', 'override url for issues, use {id} for issue id') // -i kept for back compatibility
.option('-i, --issue-url <url>', 'override url for issues, use {id} for issue id') // -i kept for back compatibility
.option('--merge-url <url>', 'override url for merges, use {id} for merge id')
.option('--compare-url <url>', 'override url for compares, use {from} and {to} for tags')
.option('--issue-pattern <regex>', 'override regex pattern for issues in commit messages')
Expand Down
10 changes: 10 additions & 0 deletions test/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ describe('getOptions', () => {
const options = await getOptions(['', '', '--commit-limit', 'false'])
expect(options.commitLimit).to.equal(false)
})

it('parses --issue-url correctly when given --issue-url', async () => {
const options = await getOptions(['', '', '--issue-url', 'https://test.issue.local/issues/{id}'])
expect(options.issueUrl).to.equal('https://test.issue.local/issues/{id}')
})

it('parses -i correctly when given -i', async () => {
const options = await getOptions(['', '', '-i', 'https://test.issue.local/issues/{id}'])
expect(options.issueUrl).to.equal('https://test.issue.local/issues/{id}')
})
})

describe('run', () => {
Expand Down

0 comments on commit 5041b3e

Please sign in to comment.