-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Labels
bugCommander is not working as intendedCommander is not working as intended
Milestone
Description
index.js
var command = require('commander')
var cmd = command
.command('hello', 'description')
.parse(process.argv)index-hello.js
var command = require('commander')
var cmd = command
.option('--dry-run', 'prints actions, but takes none')
.parse(process.argv)
console.log('opts', cmd.opts())
console.log('args', cmd.args)output
$ node index.js hello 1 2 --dry-run 3 4 5 6
opts { dryRun: true }
args [ '1', '2', '4', '5', '6', '3' ]
Note how 3 has been shifted to the end. This really messes with you when working with subcommands that expect a specific argument ordering.
Found and tested against commander@2.9.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugCommander is not working as intendedCommander is not working as intended