Closed
Description
strict {Boolean} (Optional) A Boolean on wheather or not to throw an error when unknown args are encountered
The current interface is leaning towards the minimal (magic) configuration goal of the original proposal. I do not currently see a way of declaring an option as being known but not taking a value, so there is no way to identify unknown options?
The FAQ includes:
Do unknown arguments raise an error? Are they parsed? Are they treated as positional arguments?
no, they are parsed, not treated as positionals
Related:
- Default Behavior: Boolean Flags in util: add util.parseArgs() nodejs/node#35015 (comment)
- util: add util.parseArgs() nodejs/node#35015 (comment)
- util: add util.parseArgs() nodejs/node#35015 (comment)
- util: add util.parseArgs() nodejs/node#35015 (comment)
(A different case is --foo=bar
when foo
is not specified to take an argument value. Not including that as part of strict for current question. nodejs/node#35015 (comment))