Here is a command with two flags whose type differs only by optionality (and spelling)
enum Enum: String, CaseIterable { case s, t, u }
struct Options: ParsableCommand {
@Flag(name: .short, exclusivity: .exclusive) var flag1: Enum
@Flag(name: .long, exclusivity: .exclusive) var flag2: Enum?
}
let options = Options.parseOrExit()
The two flags will report errors rather differently:
$ options -s -t
Error: Value to be set with flag '-t' had already been set with flag '-s'
Usage: options -s -t -u [--s] [--t] [--u]
$ options --s --t
Error: Unexpected argument 't'
Usage: options -s -t -u [--s] [--t] [--u]
Cause: the two Flag instances use two very different constructors. Presumably they diverged during development.