From 3fc2de1ba4f3470e470cb2d8aedbfe420be26e48 Mon Sep 17 00:00:00 2001 From: Gyanendra Mishra Date: Thu, 2 Feb 2023 16:28:13 +0000 Subject: [PATCH] removed changes that arent necessary for new bash --- bash_completions.go | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/bash_completions.go b/bash_completions.go index 5adcbb77..a9f4e4f2 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -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))