commander
Advanced tools
Changelog
[3.0.2] (2019-09-27)
<!-- markdownlint-disable MD024 -->Changelog
[3.0.1] (2019-08-30)
executableFile
in CommandOptions ([#1028])const
rather than var
in README ([#1026])Changelog
[3.0.0] / 2019-08-08
.command('clone', 'clone description', { executableFile: 'myClone' })
.command
to contrast action handler vs git-style executable. ([#938] [#990]).command
. ([#938] [#990])-p 80
can also be supplied as -p80
node --harmony myCommand.js clone
.version
([#963])
program.version('0.0.1', '-v, --vers', 'output the current version')
.helpOption(flags, description)
routine to customise help flags and description ([#963])
.helpOption('-e, --HELP', 'read more information')
--foo
and --no-foo
--no-foo
on cli now emits option:no-foo
(previously option:foo
)--no-foo
after defining --foo
leaves the default value unchanged (previously set it to false)node --inspect myCommand.js clone
The custom event for a negated option like --no-foo
is option:no-foo
(previously option:foo
).
program
.option('--no-foo')
.on('option:no-foo', () => {
console.log('removing foo');
});
When using TypeScript, adding a command does not allow an explicit undefined
for an unwanted executable description (e.g
for a command with an action handler).
program
.command('action1', undefined, { noHelp: true }) // No longer valid
.command('action2', { noHelp: true }) // Correct
Changelog
2.20.0 / 2019-04-02
Changelog
2.19.0 / 2018-10-02
Changelog
2.18.0 / 2018-09-07
Changelog
2.17.0 / 2018-08-03
Changelog
2.16.0 / 2018-06-29
test/run
(#821)