You can support for -v
instead of -V
to get the --version
to be consistent with Node and npm.
It's just a customization:
.version('1.0.0', '-v, --version')
If the flags aren't specified, they just default to -V, --version.
const commander = require( 'commander' ); | |
const packageJson = require( './package.json' ); | |
const program = new commander.Command( packageJson.name ) | |
.version( packageJson.version, '-v, --version' ) | |
.parse( process.argv ); |
@mojavelinux why would you like to change that? But I can see I never tested that.