Skip to content
This repository has been archived by the owner on Jan 1, 2022. It is now read-only.

clap_generate fish: ArgEnum completions not working on toplevel command #202

Open
epage opened this issue Dec 6, 2021 · 3 comments
Open

Comments

@epage
Copy link
Owner

epage commented Dec 6, 2021

Issue by ModProg
Friday Aug 20, 2021 at 00:44 GMT
Originally opened as clap-rs/clap#2729


Rust Version

rustc 1.54.0 (a178d0322 2021-07-26)

Clap Version

master

Minimal reproducible code

use clap::{ArgEnum, Clap, IntoApp};
use clap_generate::generators;

fn main() {
    clap_generate::generate::<generators::Fish, _>(
        &mut App::into_app(),
        "clap-issue",
        &mut std::io::stdout(),
    );
}

#[derive(Clap)]
struct App {
    #[clap(arg_enum)]
    arg: A,
}


#[derive(ArgEnum)]
enum A {
    A,
    B,
}

Steps to reproduce the bug with the above code

cargo run

Actual Behaviour

complete -c clap-issue -s h -l help -d 'Print help information'
complete -c clap-issue -s V -l version -d 'Print version information'

Expected Behaviour

complete -c clap-issue -s h -l help -d 'Print help information'
complete -c clap-issue -s V -l version -d 'Print version information'
complete -c clap-issue -r -f -a "a b"

Additional Context

No response

Debug Output

No response

@epage
Copy link
Owner Author

epage commented Dec 6, 2021

Comment by ModProg
Friday Aug 20, 2021 at 14:03 GMT


I'll investigate if this also applies to other shells

@epage
Copy link
Owner Author

epage commented Dec 6, 2021

Comment by ModProg
Friday Aug 20, 2021 at 21:47 GMT


Works in zsh so is only a fish issue

@epage
Copy link
Owner Author

epage commented Dec 6, 2021

Comment by epage
Monday Aug 23, 2021 at 14:28 GMT


Thanks for reporting this!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant