Skip to content

Commit

Permalink
Fix commander argument syntax
Browse files Browse the repository at this point in the history
Square brackets implies optional input, whereas they are all required (if the option is being used)
  • Loading branch information
cookpete committed Jul 7, 2019
1 parent b75a9eb commit 01739fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ Options:
--sort-commits [property] # sort commits by property [relevance, date, date-desc], default: relevance
--include-branch [branch] # one or more branches to include commits from, comma separated
--release-summary # display tagged commit message body as release summary
--handlebars-setup # handlebars setup file
--handlebars-setup [file] # handlebars setup file
--stdout # output changelog to stdout
-V, --version # output the version number
-h, --help # output usage information
Expand Down
32 changes: 16 additions & 16 deletions src/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,24 +24,24 @@ const OPTIONS_DOTFILE = '.auto-changelog'

async function getOptions (argv) {
const options = new Command()
.option('-o, --output [file]', `output file, default: ${DEFAULT_OPTIONS.output}`)
.option('-t, --template [template]', `specify template to use [compact, keepachangelog, json], default: ${DEFAULT_OPTIONS.template}`)
.option('-r, --remote [remote]', `specify git remote to use for links, default: ${DEFAULT_OPTIONS.remote}`)
.option('-o, --output <file>', `output file, default: ${DEFAULT_OPTIONS.output}`)
.option('-t, --template <template>', `specify template to use [compact, keepachangelog, json], default: ${DEFAULT_OPTIONS.template}`)
.option('-r, --remote <remote>', `specify git remote to use for links, default: ${DEFAULT_OPTIONS.remote}`)
.option('-p, --package [file]', 'use version from file as latest release, default: package.json')
.option('-v, --latest-version [version]', 'use specified version as latest release')
.option('-v, --latest-version <version>', 'use specified version as latest release')
.option('-u, --unreleased', 'include section for unreleased changes')
.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('-i, --issue-url [url]', 'override url for issues, use {id} for issue id')
.option('--issue-pattern [regex]', 'override regex pattern for issues in commit messages')
.option('--breaking-pattern [regex]', 'regex pattern for breaking change commits')
.option('--merge-pattern [regex]', 'add custom regex pattern for merge commits')
.option('--ignore-commit-pattern [regex]', 'pattern to ignore when parsing commits')
.option('--tag-pattern [regex]', 'override regex pattern for release tags')
.option('--tag-prefix [prefix]', 'prefix used in version tags')
.option('--starting-commit [hash]', 'starting commit to use for changelog generation')
.option('--sort-commits [property]', `sort commits by property [relevance, date, date-desc], default: ${DEFAULT_OPTIONS.sortCommits}`)
.option('--include-branch [branch]', 'one or more branches to include commits from, comma separated', str => str.split(','))
.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('-i, --issue-url <url>', 'override url for issues, use {id} for issue id')
.option('--issue-pattern <regex>', 'override regex pattern for issues in commit messages')
.option('--breaking-pattern <regex>', 'regex pattern for breaking change commits')
.option('--merge-pattern <regex>', 'add custom regex pattern for merge commits')
.option('--ignore-commit-pattern <regex>', 'pattern to ignore when parsing commits')
.option('--tag-pattern <regex>', 'override regex pattern for release tags')
.option('--tag-prefix <prefix>', 'prefix used in version tags')
.option('--starting-commit <hash>', 'starting commit to use for changelog generation')
.option('--sort-commits <property>', `sort commits by property [relevance, date, date-desc], default: ${DEFAULT_OPTIONS.sortCommits}`)
.option('--include-branch <branch>', 'one or more branches to include commits from, comma separated', str => str.split(','))
.option('--release-summary', 'use tagged commit message body as release summary')
.option('--handlebars-setup <file>', 'handlebars setup file')
.option('--stdout', 'output changelog to stdout')
Expand Down

0 comments on commit 01739fe

Please sign in to comment.