-
|
when generating completions with multiple possible long arguments it seems like clap_complete generates invalid fish completions I haven't made a minimum reproducible case yet, but I plan on in short, clap_complete generates the following line: complete -c rtag -n "__fish_rtag_using_subcommand get" -s 0 -l print0 nullwhich is wrong, it should be: complete -c rtag -n "__fish_rtag_using_subcommand get" -s 0 -l print0 -l nullI am using derive to build my cli and relevant parts of cli struct are: // [...] Importing clap
#[derive(Parser)]
#[command(name = "rtag",
version, about, long_about = None)]
pub(crate) struct Cli {
#[command(subcommand)]
pub(crate) command: Option<Commands>,
}
#[derive(Subcommand)]
pub(crate) enum Commands {
Get {
#[arg(short = '0', long = "print0, null")]
nullprint: bool,
#[arg(value_name = "FILES", required = true)]
paths: Vec<PathBuf>,
},
// [...] other subcommands
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
I figured out what is going on, for anyone having this same issue |
Beta Was this translation helpful? Give feedback.
I figured out what is going on,
long = "print0, null"sets one long flag--print0, nulland not 2, my badfor anyone having this same issue
just change this
#[arg(short = '0', long = "print0, null")]to
#[arg(short = '0', long = "print0", alias = "null")]