mirror of
https://github.com/clap-rs/clap
synced 2025-01-18 23:53:54 +00:00
fix(bash completion): Change the bash completion script code generation to support hyphens.
This commit is contained in:
parent
b446a561ce
commit
ba7f1d18eb
2 changed files with 4 additions and 3 deletions
|
@ -81,10 +81,11 @@ complete -F _{name} -o bashdefault -o default {name}
|
|||
subcmds = format!(
|
||||
"{}
|
||||
{name})
|
||||
cmd+=\"__{name}\"
|
||||
cmd+=\"__{fn_name}\"
|
||||
;;",
|
||||
subcmds,
|
||||
name = sc.replace("-", "__")
|
||||
name = sc,
|
||||
fn_name = sc.replace("-", "__")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -525,7 +525,7 @@ static BASH_SPECIAL_CMDS: &'static str = r#"_my_app() {
|
|||
help)
|
||||
cmd+="__help"
|
||||
;;
|
||||
some__cmd__with__hypens)
|
||||
some-cmd-with-hypens)
|
||||
cmd+="__some__cmd__with__hypens"
|
||||
;;
|
||||
some_cmd)
|
||||
|
|
Loading…
Reference in a new issue