mirror of
https://github.com/clap-rs/clap
synced 2024-11-10 06:44:16 +00:00
fix(complete): Ensure bash does not sort, we do
This commit is contained in:
parent
3ec980e7ad
commit
34c86159a9
3 changed files with 15 additions and 3 deletions
|
@ -317,7 +317,11 @@ _clap_complete_NAME() {
|
|||
compopt -o nospace
|
||||
fi
|
||||
}
|
||||
complete -o nospace -o bashdefault -F _clap_complete_NAME BIN
|
||||
if [[ \"${{BASH_VERSINFO[0]}}\" -eq 4 && \"${{BASH_VERSINFO[1]}}\" -ge 4 || \"${{BASH_VERSINFO[0]}}\" -gt 4 ]]; then
|
||||
complete -o nospace -o bashdefault -o nosort -F _clap_complete_NAME BIN
|
||||
else
|
||||
complete -o nospace -o bashdefault -F _clap_complete_NAME BIN
|
||||
fi
|
||||
"#
|
||||
.replace("NAME", &escaped_name)
|
||||
.replace("BIN", bin)
|
||||
|
|
|
@ -17,6 +17,10 @@ _clap_complete_exhaustive() {
|
|||
compopt -o nospace
|
||||
fi
|
||||
}
|
||||
complete -o nospace -o bashdefault -F _clap_complete_exhaustive exhaustive
|
||||
if [[ \"${{BASH_VERSINFO[0]}}\" -eq 4 && \"${{BASH_VERSINFO[1]}}\" -ge 4 || \"${{BASH_VERSINFO[0]}}\" -gt 4 ]]; then
|
||||
complete -o nospace -o bashdefault -o nosort -F _clap_complete_exhaustive exhaustive
|
||||
else
|
||||
complete -o nospace -o bashdefault -F _clap_complete_exhaustive exhaustive
|
||||
fi
|
||||
|
||||
|
||||
|
|
|
@ -15,5 +15,9 @@ _clap_complete_my_app() {
|
|||
compopt -o nospace
|
||||
fi
|
||||
}
|
||||
complete -o nospace -o bashdefault -F _clap_complete_my_app my-app
|
||||
if [[ /"${{BASH_VERSINFO[0]}}/" -eq 4 && /"${{BASH_VERSINFO[1]}}/" -ge 4 || /"${{BASH_VERSINFO[0]}}/" -gt 4 ]]; then
|
||||
complete -o nospace -o bashdefault -o nosort -F _clap_complete_my_app my-app
|
||||
else
|
||||
complete -o nospace -o bashdefault -F _clap_complete_my_app my-app
|
||||
fi
|
||||
|
||||
|
|
Loading…
Reference in a new issue