swift-argument-parser
swift-argument-parser copied to clipboard
Support an argument as a flag or option
As a command line tool developer, I want to be able to have an argument defined as a flag or as an option.
Our CLI tool currently has a Flag argument. I want to expand this argument to be an option, but I want to preserve backward compatibility. For example, if --show-bin-path is provided, I want it to executed --show-bin-path text, but I also want to support --show-bin-path json
See https://github.com/apple/swift-argument-parser/pull/830#issuecomment-3561691337 for an alternate implementation proposal.