We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustc 1.52.1 (9bc8c42bb 2021-05-09)
3.0.0-beta.2
use clap::{ArgEnum, Clap, IntoApp}; #[derive(Clap, Debug)] pub struct App { #[clap(arg_enum)] pub shell: Shell, } #[derive(ArgEnum, Debug)] pub enum Shell { Bash, Fish, Zsh, } fn main() { let mut app = App::into_app(); clap_generate::generate::<clap_generate::generators::Bash, _>( &mut app, "play", &mut std::io::stdout(), ); }
cargo run
Assuming a binary name of foo, if I type in fooTab, I get the following completions:
foo
-h --help <shell> -V --version
The <shell> value is a placeholder, it's not supposed to be used in completions.
<shell>
I should have gotten the options of bash, fish, zsh instead.
bash
fish
zsh
The full generated bash completions are:
_play() { local i cur prev opts cmds COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" cmd="" opts="" for i in ${COMP_WORDS[@]} do case "${i}" in play) cmd="play" ;; *) ;; esac done case "${cmd}" in play) opts=" -h -V --help --version <shell> " if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 fi case "${prev}" in *) COMPREPLY=() ;; esac COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) return 0 ;; esac } complete -F _play -o bashdefault -o default play
No response
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Please complete the following tasks
Rust Version
rustc 1.52.1 (9bc8c42bb 2021-05-09)
Clap Version
3.0.0-beta.2
Minimal reproducible code
Steps to reproduce the bug with the above code
Actual Behaviour
Assuming a binary name of
foo
, if I type infoo
Tab, I get the following completions:Expected Behaviour
The
<shell>
value is a placeholder, it's not supposed to be used in completions.I should have gotten the options of
bash
,fish
,zsh
instead.Additional Context
The full generated bash completions are:
Debug Output
No response
The text was updated successfully, but these errors were encountered: