Skip to content

Commit 01739fe

Browse files
committed
Fix commander argument syntax
Square brackets implies optional input, whereas they are all required (if the option is being used)
1 parent b75a9eb commit 01739fe

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Options:
4040
--sort-commits [property] # sort commits by property [relevance, date, date-desc], default: relevance
4141
--include-branch [branch] # one or more branches to include commits from, comma separated
4242
--release-summary # display tagged commit message body as release summary
43-
--handlebars-setup # handlebars setup file
43+
--handlebars-setup [file] # handlebars setup file
4444
--stdout # output changelog to stdout
4545
-V, --version # output the version number
4646
-h, --help # output usage information

src/run.js

+16-16
Original file line numberDiff line numberDiff line change
@@ -24,24 +24,24 @@ const OPTIONS_DOTFILE = '.auto-changelog'
2424

2525
async function getOptions (argv) {
2626
const options = new Command()
27-
.option('-o, --output [file]', `output file, default: ${DEFAULT_OPTIONS.output}`)
28-
.option('-t, --template [template]', `specify template to use [compact, keepachangelog, json], default: ${DEFAULT_OPTIONS.template}`)
29-
.option('-r, --remote [remote]', `specify git remote to use for links, default: ${DEFAULT_OPTIONS.remote}`)
27+
.option('-o, --output <file>', `output file, default: ${DEFAULT_OPTIONS.output}`)
28+
.option('-t, --template <template>', `specify template to use [compact, keepachangelog, json], default: ${DEFAULT_OPTIONS.template}`)
29+
.option('-r, --remote <remote>', `specify git remote to use for links, default: ${DEFAULT_OPTIONS.remote}`)
3030
.option('-p, --package [file]', 'use version from file as latest release, default: package.json')
31-
.option('-v, --latest-version [version]', 'use specified version as latest release')
31+
.option('-v, --latest-version <version>', 'use specified version as latest release')
3232
.option('-u, --unreleased', 'include section for unreleased changes')
33-
.option('-l, --commit-limit [count]', `number of commits to display per release, default: ${DEFAULT_OPTIONS.commitLimit}`, parseLimit)
34-
.option('-b, --backfill-limit [count]', `number of commits to backfill empty releases with, default: ${DEFAULT_OPTIONS.backfillLimit}`, parseLimit)
35-
.option('-i, --issue-url [url]', 'override url for issues, use {id} for issue id')
36-
.option('--issue-pattern [regex]', 'override regex pattern for issues in commit messages')
37-
.option('--breaking-pattern [regex]', 'regex pattern for breaking change commits')
38-
.option('--merge-pattern [regex]', 'add custom regex pattern for merge commits')
39-
.option('--ignore-commit-pattern [regex]', 'pattern to ignore when parsing commits')
40-
.option('--tag-pattern [regex]', 'override regex pattern for release tags')
41-
.option('--tag-prefix [prefix]', 'prefix used in version tags')
42-
.option('--starting-commit [hash]', 'starting commit to use for changelog generation')
43-
.option('--sort-commits [property]', `sort commits by property [relevance, date, date-desc], default: ${DEFAULT_OPTIONS.sortCommits}`)
44-
.option('--include-branch [branch]', 'one or more branches to include commits from, comma separated', str => str.split(','))
33+
.option('-l, --commit-limit <count>', `number of commits to display per release, default: ${DEFAULT_OPTIONS.commitLimit}`, parseLimit)
34+
.option('-b, --backfill-limit <count>', `number of commits to backfill empty releases with, default: ${DEFAULT_OPTIONS.backfillLimit}`, parseLimit)
35+
.option('-i, --issue-url <url>', 'override url for issues, use {id} for issue id')
36+
.option('--issue-pattern <regex>', 'override regex pattern for issues in commit messages')
37+
.option('--breaking-pattern <regex>', 'regex pattern for breaking change commits')
38+
.option('--merge-pattern <regex>', 'add custom regex pattern for merge commits')
39+
.option('--ignore-commit-pattern <regex>', 'pattern to ignore when parsing commits')
40+
.option('--tag-pattern <regex>', 'override regex pattern for release tags')
41+
.option('--tag-prefix <prefix>', 'prefix used in version tags')
42+
.option('--starting-commit <hash>', 'starting commit to use for changelog generation')
43+
.option('--sort-commits <property>', `sort commits by property [relevance, date, date-desc], default: ${DEFAULT_OPTIONS.sortCommits}`)
44+
.option('--include-branch <branch>', 'one or more branches to include commits from, comma separated', str => str.split(','))
4545
.option('--release-summary', 'use tagged commit message body as release summary')
4646
.option('--handlebars-setup <file>', 'handlebars setup file')
4747
.option('--stdout', 'output changelog to stdout')

0 commit comments

Comments
 (0)