Replies: 1 comment 1 reply
-
It's not a big. It's how the Unix CLI philosophy is. You cannot provide
more short options when the previous short option can take values.
…On Mon, Oct 26, 2020, 18:59 Colin Woodbury ***@***.***> wrote:
I'm having an issue with clap 3.0.0-beta.2. I have some conflicts
defined, which work in their long forms:
> cargo run -- -S --search --info linux
error: The argument '--info <PACKAGE>...' cannot be used with '--search <PACKAGE>...'
Both --search and --info accept values, so this is expected. But the same
thing doesn't happen with their short forms:
> cargo run -- -Ssi linux
ArgMatches { args: {}, subcommand: Some(SubCommand { id: sync, name: "sync", matches: ArgMatches { args: {search: MatchedArg { occurs: 1, ty: CommandLine, indices: [3, 4], vals: ["i", "linux"] }}, subcommand: None } }) }
Notice that the i got eaten up as an arg to -s, which can accept multiple
values. The same thing happens for values that don't accept args, if
they're included as flags:
> cargo run -- -Ssq linux
ArgMatches { args: {}, subcommand: Some(SubCommand { id: sync, name: "sync", matches: ArgMatches { args: {search: MatchedArg { occurs: 1, ty: CommandLine, indices: [3, 4], vals: ["q", "linux"] }}, subcommand: None } }) }
Is this a bug? If not, is there a way to disable "adjacent" value
detection with short-style options?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2185>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABKU37HS2QDXMZFHDLMVVTSMW2JBANCNFSM4S7XBF4A>
.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
fosskers
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm having an issue with
clap 3.0.0-beta.2
. I have some conflicts defined, which work in their long forms:Both
--search
and--info
accept values, so this is expected. But the same thing doesn't happen with their short forms:Notice that the
i
got eaten up as an arg to-s
, which can accept multiple values. The same thing happens for flags that don't accept args:-q
got eaten up. Is this a bug? If not, is there a way to disable "adjacent" value detection with short-style options?Beta Was this translation helpful? Give feedback.
All reactions