mirror of
https://github.com/clap-rs/clap
synced 2024-12-14 14:52:33 +00:00
Allow bash completions to work with an alias (clap-rs/clap#2054)
This commit is contained in:
parent
bc4c29056f
commit
a9f4d759c0
2 changed files with 4 additions and 4 deletions
|
@ -33,7 +33,7 @@ impl Generator for Bash {
|
||||||
for i in ${{COMP_WORDS[@]}}
|
for i in ${{COMP_WORDS[@]}}
|
||||||
do
|
do
|
||||||
case \"${{i}}\" in
|
case \"${{i}}\" in
|
||||||
{name})
|
\"$1\")
|
||||||
cmd=\"{cmd}\"
|
cmd=\"{cmd}\"
|
||||||
;;{subcmds}
|
;;{subcmds}
|
||||||
*)
|
*)
|
||||||
|
|
|
@ -42,7 +42,7 @@ static BASH: &str = r#"_myapp() {
|
||||||
for i in ${COMP_WORDS[@]}
|
for i in ${COMP_WORDS[@]}
|
||||||
do
|
do
|
||||||
case "${i}" in
|
case "${i}" in
|
||||||
myapp)
|
"$1")
|
||||||
cmd="myapp"
|
cmd="myapp"
|
||||||
;;
|
;;
|
||||||
help)
|
help)
|
||||||
|
@ -139,7 +139,7 @@ static BASH_SPECIAL_CMDS: &str = r#"_my_app() {
|
||||||
for i in ${COMP_WORDS[@]}
|
for i in ${COMP_WORDS[@]}
|
||||||
do
|
do
|
||||||
case "${i}" in
|
case "${i}" in
|
||||||
my_app)
|
"$1")
|
||||||
cmd="my_app"
|
cmd="my_app"
|
||||||
;;
|
;;
|
||||||
help)
|
help)
|
||||||
|
@ -285,7 +285,7 @@ static BASH_ALIASES: &str = r#"_cmd() {
|
||||||
for i in ${COMP_WORDS[@]}
|
for i in ${COMP_WORDS[@]}
|
||||||
do
|
do
|
||||||
case "${i}" in
|
case "${i}" in
|
||||||
cmd)
|
"$1")
|
||||||
cmd="cmd"
|
cmd="cmd"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|
Loading…
Reference in a new issue