diff --git a/autocomplete/bash_autocomplete b/autocomplete/bash_autocomplete index f5a8d1f..a118bda 100755 --- a/autocomplete/bash_autocomplete +++ b/autocomplete/bash_autocomplete @@ -7,7 +7,7 @@ _cli_bash_autocomplete() { local cur opts base COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" - if [[ $cur == -* ]]; then + if [[ "$cur" == "-"* ]]; then opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} ${cur} --generate-bash-completion ) else opts=$( ${COMP_WORDS[@]:0:$COMP_CWORD} --generate-bash-completion ) diff --git a/help.go b/help.go index 8e74ec4..efc3889 100644 --- a/help.go +++ b/help.go @@ -183,7 +183,7 @@ func printCommandSuggestions(commands []Command, writer io.Writer) { func cliArgContains(flagName string) bool { for _, name := range strings.Split(flagName, ",") { - name = strings.Trim(name, " ") + name = strings.TrimSpace(name) count := utf8.RuneCountInString(name) if count > 2 { count = 2