swift-argument-parser
swift-argument-parser copied to clipboard
Exclusive Option Groups
Flags can be mutually exclusive, but there isn't a way to do that for options. e.g. you can't have [--arch <arch> | --target <target>] Ideally these could be nested like [[--one <one> --two <two>] | [--combo <combo>]]
Could flags, options, and arguments be allowed to be exclusive with each other by adding an exclusive: Bool = false argument to @OptionGroup()?
Current behavior is exclusive == false, which allows all of the options/flags/arguments in the group to be used in the same command line.
When exclusive == true, only one of the options/flags/arguments in the group can be used in a command line.