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

Warn/validate commands with optional arguments before non-optional

Open natecook1000 opened this issue 3 years ago • 1 comments

As described in #489, a command that declares an optional @Argument before a non-optional @Argument won't ever allow a single-argument call. It would be nice if ArgumentParser provided a validation warning / error so that authors could move to a different design.

natecook1000 avatar Sep 23 '22 15:09 natecook1000

I would consider this a logic bug and be a reasonable cause to fatalError or preconditionFailure.

rauhul avatar Sep 23 '22 16:09 rauhul