You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 26, 2021. It is now read-only.
Flags are considered to be strictly optional despite the surrounding grammar. For instance, the following example documented on http://docopt.org/ does not enforce the requirement that one of the mutually exclusive flags be provided.
Mutually-exclusive elements can be separated with a pipe "|" as follows:
Usage: my_program go (--up | --down | --left | --right)
Use parens "( )" to group elements when one of the mutually exclusive cases is required.
The text was updated successfully, but these errors were encountered:
I am working on a feature branch feature/required-flags that will introduce an option requireFlags that will cause the desired behaviour. I am open for a discussion wether or not that should be the default behaviour for neodoc. For the time being it is opt-in.
The branch is coming along nicely and it had the positive side effect that error messages got more love, since in the context of missing flags, they left a lot to be desired off. For example, instead of saying that a group in it's entirety failed, it will track the reason and print that reason. Further, it makes now a distinction between missing arguments and unmet expectations (got '-a' in place of '-b'). But I digress. I will see to have a npm-tagged prerelease to play with later today.
There's a tagged release available if you'd like to give it a go. Any feedback would be very welcome - just do npm i neodoc@required-flags. Please let me know if the behaviour is as you'd expect and if the error messages are sufficiently helpful.
Flags are considered to be strictly optional despite the surrounding grammar. For instance, the following example documented on http://docopt.org/ does not enforce the requirement that one of the mutually exclusive flags be provided.
The text was updated successfully, but these errors were encountered: