From 5041b3ee8dc919cb46bbef79d6e4edaeac70471f Mon Sep 17 00:00:00 2001 From: Brandon Harris Date: Tue, 29 Oct 2019 16:17:03 -0500 Subject: [PATCH] fix parsing of --issue-url and -i options (#138) --- src/run.js | 2 +- test/run.js | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/run.js b/src/run.js index f9f0e26c..d25d0b7c 100644 --- a/src/run.js +++ b/src/run.js @@ -35,7 +35,7 @@ async function getOptions (argv) { .option('-l, --commit-limit ', `number of commits to display per release, default: ${DEFAULT_OPTIONS.commitLimit}`, parseLimit) .option('-b, --backfill-limit ', `number of commits to backfill empty releases with, default: ${DEFAULT_OPTIONS.backfillLimit}`, parseLimit) .option('--commit-url ', 'override url for commits, use {id} for commit id') - .option('--issue-url, -i ', 'override url for issues, use {id} for issue id') // -i kept for back compatibility + .option('-i, --issue-url ', 'override url for issues, use {id} for issue id') // -i kept for back compatibility .option('--merge-url ', 'override url for merges, use {id} for merge id') .option('--compare-url ', 'override url for compares, use {from} and {to} for tags') .option('--issue-pattern ', 'override regex pattern for issues in commit messages') diff --git a/test/run.js b/test/run.js index 75229dd3..84de1a01 100644 --- a/test/run.js +++ b/test/run.js @@ -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', () => {