cli
cli copied to clipboard
Support required options
Support required options.
If it was option combinations, that is having one implies another, I could then understand. Otherwise the meaning of the word option implies that it is not obligatory or that something else is the default. If you feel you need a required option why not define a sub-command or a sub-sub-command? In any case it is as trivial as _, defined := opts["option name"]
to check if one was actually passed, so not sure it justifies an API change. Being required, or optional, is something that positional arguments can be (at the end of the definition).