-
Notifications
You must be signed in to change notification settings - Fork 11
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
This came up here, but I wanted to split it out to track it explicitly.
I think that reporting the indexes of arguments within args would be a helpful addition, because it lets you build a bunch of more complicated logic on top of parseArgs without needing to do a full re-parse.
For example, this would make it straightforward to:
- resolve conflicts between
--fooand--no-fooas last-wins - throw on duplicate flags (check if the flag occurs at multiple indexes)
- if someday defaults are added, check to see if an option was provided by a user or came from the default (Restructure result conventions (again) #70 (comment))
- enforce that value-taking arguments are all specified using
--foo=barrather than--foo bar(check each to see ifargs[index].includes('=')) - enforce that two flags are specified in a specific order (
--enable-experimental-optionsbefore--some-unstable-option, e.g.)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request