-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
A-completionArea: completion generatorArea: completion generatorC-bugCategory: bugCategory: bugE-easyCall for participation: Experience needed to fix: Easy / not muchCall for participation: Experience needed to fix: Easy / not much
Description
Please complete the following tasks
- I have searched the discussions
- I have searched the open and rejected issues
Rust Version
rustc 1.71.0-nightly (f9a6b7158 2023-05-05)
Clap Version
4.2.7
Minimal reproducible code
use clap::{CommandFactory, Parser, Subcommand};
use clap_complete::generate;
#[derive(Parser)]
struct Opt {
#[arg(last(true))]
pub free_args: Vec<String>,
#[command(subcommand)]
command: SubOpt,
}
#[derive(Subcommand)]
enum SubOpt {
Foo,
Bar,
}
fn main() {
let mut cmd = Opt::command();
let name = cmd.get_name().to_string();
generate(clap_complete::shells::Zsh, &mut cmd, name, &mut std::io::stdout());
}
Steps to reproduce the bug with the above code
Redirect the output to a file, use source poc.zsh
to load it, then enter <app-name>
and hit tab.
Actual Behaviour
_arguments:comparguments:327: doubled rest argument definition: *::: :->poc
Expected Behaviour
An error should not occur and completion should work as normal.
Additional Context
I'm unsure if this is related to #4652, but it prevents completion from working at all
Debug Output
No response
Metadata
Metadata
Assignees
Labels
A-completionArea: completion generatorArea: completion generatorC-bugCategory: bugCategory: bugE-easyCall for participation: Experience needed to fix: Easy / not muchCall for participation: Experience needed to fix: Easy / not much