If true, parsing will stop at the first unknown argument and the remaining arguments returned in _unknown.
true
_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' }
There was an error while loading. Please reload this page.