see relevant discussion on the swift forums here: https://forums.swift.org/t/why-does-swift-treat-double-dash-command-line-arguments-differently/77727/8
ArgumentParser version:
main branch (commit: a01856b)
Swift version:
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx14.0
Checklist
Steps to Reproduce
run this test case in ParsableArgumentsValidationTests:
extension ParsableArgumentsValidationTests {
func test_shouldMaybeProduceUnknownOptionErrorInsteadOfMissingValue() throws {
struct SomeArgs: ParsableArguments {
@Option(name: .shortAndLong)
var x_arg: Int
@Option(name: .shortAndLong)
var z_arg: Int
}
// swap order of 'x' and 'z' in the string to get different error output
AssertErrorMessage(
SomeArgs.self,
[
"-should_maybe_be_an_unknown_option_error_but_is_a_missing_value_error_when_it_includes_x_or_z",
],
"Unknown option '-should_maybe_be_an_unknown_option_error_but_is_a_missing_value_error_when_it_includes_x_or_z'"
)
// actually: "Missing value for '-x <x_arg>'"
}
}
Expected behavior
an error indicating the given option is unrecognized
Actual behavior
an error is produced suggesting that the option name is valid but is missing a value
see relevant discussion on the swift forums here: https://forums.swift.org/t/why-does-swift-treat-double-dash-command-line-arguments-differently/77727/8
ArgumentParser version:
mainbranch (commit: a01856b)Swift version:
swift-driver version: 1.115 Apple Swift version 6.0.2 (swiftlang-6.0.2.1.2 clang-1600.0.26.4)
Target: arm64-apple-macosx14.0
Checklist
mainbranch of this packageSteps to Reproduce
run this test case in
ParsableArgumentsValidationTests:Expected behavior
an error indicating the given option is unrecognized
Actual behavior
an error is produced suggesting that the option name is valid but is missing a value