Closed rauschma closed 4 years ago
Pretty much the existing scope of features is the intended scope of features, honestly. Any sort of conditional logic is considered out of scope. Usually "required" arguments are handled by if (!args['--some-arg']) throw new Error('--some-arg is required')
- at least, that's how we intend.
I'm :+1: for an FAQ, however :)
Finally got around to this, thanks for pointing it out @rauschma. Also super weird coincidence, I just came back to this repo to look for something right after finding your openurl
module and decided to take a look at this issue. Had to go back and check who the author was!
Anyway, FAQ in the readme now. :)
Would it make sense to support required arguments? For example:
Alternatively:
arg.required()
would print an error message and exit Node.js. Downsides of this approach: Doesn’t handle aliases, redundancy.If this is out of scope, it would be a good FAQ, because many shell argument parsing libraries support this feature.