-
Notifications
You must be signed in to change notification settings - Fork 105
stopAtFirstUnknown
Lloyd Brookes edited this page Jan 17, 2018
·
3 revisions
If true
, parsing will stop at the first unknown argument and the remaining arguments returned in _unknown
.
const commandLineArgs = require('command-line-args')
const optionDefinitions = [
{ name: 'app' }
]
const options = commandLineArgs(optionDefinitions, { stopAtFirstUnknown: true })
console.log(options)
Running this script creates the following output.
$ node example.js --app example -m merge --squash -m My commit message
{ _unknown: [ 'merge', '--squash', '-m', 'My', 'commit', 'message' ],
app: 'example' }