mirror of
https://github.com/spf13/cobra
synced 2025-05-04 20:37:24 +00:00
removed changes that arent necessary for new bash
This commit is contained in:
parent
87cd9437e1
commit
3fc2de1ba4
1 changed files with 3 additions and 10 deletions
|
@ -81,7 +81,6 @@ __%[1]s_handle_go_custom_completion()
|
|||
local shellCompDirectiveNoFileComp=%[5]d
|
||||
local shellCompDirectiveFilterFileExt=%[6]d
|
||||
local shellCompDirectiveFilterDirs=%[7]d
|
||||
local shellCompDirectiveKeepOrder=%[8]d
|
||||
|
||||
local out requestComp lastParam lastChar comp directive args
|
||||
|
||||
|
@ -89,7 +88,7 @@ __%[1]s_handle_go_custom_completion()
|
|||
# Calling ${words[0]} instead of directly %[1]s allows to handle aliases
|
||||
args=("${words[@]:1}")
|
||||
# Disable ActiveHelp which is not supported for bash completion v1
|
||||
requestComp="%[9]s=0 ${words[0]} %[2]s ${args[*]}"
|
||||
requestComp="%[8]s=0 ${words[0]} %[2]s ${args[*]}"
|
||||
|
||||
lastParam=${words[$((${#words[@]}-1))]}
|
||||
lastChar=${lastParam:$((${#lastParam}-1)):1}
|
||||
|
@ -128,12 +127,6 @@ __%[1]s_handle_go_custom_completion()
|
|||
compopt -o nospace
|
||||
fi
|
||||
fi
|
||||
if [ $((directive & shellCompDirectiveKeepOrder)) -ne 0 ]; then
|
||||
if [[ $(type -t compopt) = "builtin" ]]; then
|
||||
__%[1]s_debug "${FUNCNAME[0]}: activating keep order"
|
||||
compopt -o nosort
|
||||
fi
|
||||
fi
|
||||
if [ $((directive & shellCompDirectiveNoFileComp)) -ne 0 ]; then
|
||||
if [[ $(type -t compopt) = "builtin" ]]; then
|
||||
__%[1]s_debug "${FUNCNAME[0]}: activating no file completion"
|
||||
|
@ -405,7 +398,7 @@ __%[1]s_handle_word()
|
|||
|
||||
`, name, ShellCompNoDescRequestCmd,
|
||||
ShellCompDirectiveError, ShellCompDirectiveNoSpace, ShellCompDirectiveNoFileComp,
|
||||
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, ShellCompDirectiveKeepOrder, activeHelpEnvVar(name)))
|
||||
ShellCompDirectiveFilterFileExt, ShellCompDirectiveFilterDirs, activeHelpEnvVar(name)))
|
||||
}
|
||||
|
||||
func writePostscript(buf io.StringWriter, name string) {
|
||||
|
@ -444,7 +437,7 @@ func writePostscript(buf io.StringWriter, name string) {
|
|||
WriteStringAndCheck(buf, fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then
|
||||
complete -o default -F __start_%s %s
|
||||
else
|
||||
complete -F __start_%s %s
|
||||
complete -o default -o nospace -F __start_%s %s
|
||||
fi
|
||||
|
||||
`, name, name, name, name))
|
||||
|
|
Loading…
Add table
Reference in a new issue