75lb / command-line-args

A mature, feature-complete library to parse command-line options.
MIT License
679 stars 107 forks source link

What exactly is the purpose of defaultOption in multiple? #128

Closed jfoclpf closed 1 year ago

jfoclpf commented 1 year ago
const commandLineArgs = require('command-line-args')
const argvOptions = commandLineArgs([
   { name: 'src', type: String, multiple: true, defaultOption: true },
])
console.log(argvOptions.onlyCP4)

when I run

node example.js --src

shouldn't output the default option?

jfoclpf commented 1 year ago

ok, I see, duplicate of #125