There seems to be inconsistent handling of enum raw values on the command line.
The following code is from CompletionScriptTests.swift:
enum Kind: String, ExpressibleByArgument, EnumerableFlag {
case one, two
case three = "custom-three"
}
@Flag var allowedKinds: [Kind] = []
@Option() var kind: Kind
case three = "custom-three" from above is considered as --three for a flag
from allowedKinds, but as custom-three as an option value for --kind.
This is the case in the 1.7.0 & main completion scripts, in ToolInfoV0 & even in SAP's
command-line argument verification. It seems to me that it should be consistent
throughout; of the 2 options, custom-three seems more sensible.
ArgumentParser version: main
Swift version:
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Checklist
There seems to be inconsistent handling of enum raw values on the command line.
The following code is from
CompletionScriptTests.swift:case three = "custom-three"from above is considered as--threefor a flagfrom
allowedKinds, but ascustom-threeas an option value for--kind.This is the case in the 1.7.0 & main completion scripts, in ToolInfoV0 & even in SAP's
command-line argument verification. It seems to me that it should be consistent
throughout; of the 2 options,
custom-threeseems more sensible.ArgumentParser version:
mainSwift version:
swift-driver version: 1.120.5 Apple Swift version 6.1 (swiftlang-6.1.0.110.21 clang-1700.0.13.3)
Target: arm64-apple-macosx15.0
Checklist
mainbranch of this package