swift-argument-parser icon indicating copy to clipboard operation
swift-argument-parser copied to clipboard

Exclusive Option Groups

Open ian-twilightcoder opened this issue 3 years ago • 1 comments

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>]]

ian-twilightcoder avatar Sep 01 '22 05:09 ian-twilightcoder

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.

rgoldberg avatar Oct 08 '24 05:10 rgoldberg