Skip to content
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.

Example

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' }