Skip to content
Myr

Allow bash-completion to work with full-path executable

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Anthony Fok · committed by Steve Francia · parent 1ef0913 · Browse files · 1 file+7 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+7 added−1 removed

  • other:+7 added−1 removed

1 file+7 added−1 removed

modified:bash_completions.go+7 added-1 removed
181 unmodified lines
182 local next_command183 if [[ -n ${last_command} ]]; then184 next_command="_${last_command}_${words[c]//:/__}"185 else186 if [[ $c -eq 0 ]]; then187 next_command="_$(basename ${words[c]//:/__})"188 else186 next_command="_${words[c]//:/__}"189 next_command="_${words[c]//:/__}"190 fi191 fi192 c=$((c+1))193 __debug "${FUNCNAME}: looking for ${next_command}"194 declare -F $next_command >/dev/null && $next_command
9 unmodified lines
204 if [[ "${words[c]}" == -* ]]; then205 __handle_flag206 elif __contains_word "${words[c]}" "${commands[@]}"; then207 __handle_command208 elif [[ $c -eq 0 ]] && __contains_word "$(basename ${words[c]})" "${commands[@]}"; then209 __handle_command210 else211 __handle_noun212 fi213 __handle_word
319 unmodified lines