mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
fix: Respect ValueHint::Other
in bash
This commit is contained in:
parent
0174326fa6
commit
2f97216156
2 changed files with 3 additions and 1 deletions
|
@ -206,6 +206,8 @@ fn vals_for(o: &Arg) -> String {
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
.join(" ")
|
.join(" ")
|
||||||
)
|
)
|
||||||
|
} else if o.get_value_hint() == ValueHint::Other {
|
||||||
|
String::from("\"${cur}\"")
|
||||||
} else {
|
} else {
|
||||||
String::from("$(compgen -f \"${cur}\")")
|
String::from("$(compgen -f \"${cur}\")")
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ _my-app() {
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
--other)
|
--other)
|
||||||
COMPREPLY=($(compgen -f "${cur}"))
|
COMPREPLY=("${cur}")
|
||||||
return 0
|
return 0
|
||||||
;;
|
;;
|
||||||
--path)
|
--path)
|
||||||
|
|
Loading…
Reference in a new issue