After updating from Swift 5.3.1 to 5.4, I'm observing that the behaviour of how swift-argument-parser handle options with the same name from two different commands has changed. For example, If I run the following commands in Swift 5.3.1:
>> swift run --configuration debug shusky install --configuration ownconfig
output: "shusky configuration: ownconfig"
>> swift run shusky install --configuration ownconfig
output: "shusky configuration: ownconfig"
the result is swift run --configuration gets the value of debug, and shusky install --configuration gets ownconfig, but If I run the same commands in Swift 5.4:
>> swift run --configuration debug shusky install --configuration ownconfig
output: "error: The value 'ownconfig' is invalid for '--configuration <configuration>'"
>> swift run shusky install --configuration ownconfig
output: "error: The value 'ownconfig' is invalid for '--configuration <configuration>'"
as we can see, swift run --configuration gets the value of ownconfig for this reason is telling us ownconfig is invalid.
ArgumentParser version: 0.3.2
Swift version: Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: arm64-apple-darwin20.5.0.
Checklist
Steps to Reproduce
You need a command line tool which contains options with similar names from swift run options, and then run:
swift run --configuration release <cli-tool> --configuration anyconf.
Expected behavior
Swift 5.4 must have the same behaviour as Swift 5.3.1.
Actual behavior
>> swift run --configuration debug shusky install --configuration ownconfig
output: "error: The value 'ownconfig' is invalid for '--configuration <configuration>'"
>> swift run shusky install --configuration ownconfig
output: "error: The value 'ownconfig' is invalid for '--configuration <configuration>'"
After updating from Swift 5.3.1 to 5.4, I'm observing that the behaviour of how swift-argument-parser handle options with the same name from two different commands has changed. For example, If I run the following commands in Swift 5.3.1:
the result is
swift run --configurationgets the value ofdebug, andshusky install --configurationgetsownconfig, but If I run the same commands in Swift 5.4:as we can see,
swift run --configurationgets the value ofownconfigfor this reason is telling us ownconfig is invalid.ArgumentParser version:
0.3.2Swift version: Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: arm64-apple-darwin20.5.0.
Checklist
mainbranch of this packageSteps to Reproduce
You need a command line tool which contains options with similar names from swift run options, and then run:
swift run --configuration release <cli-tool> --configuration anyconf.Expected behavior
Swift 5.4 must have the same behaviour as Swift 5.3.1.
Actual behavior