Skip to content

Commit

Permalink
_command_offset, route: cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
scop committed May 26, 2020
1 parent 5103c5d commit 9994be6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bash_completion
Original file line number Diff line number Diff line change
Expand Up @@ -1922,9 +1922,9 @@ _command_offset()
func=${func%% *}

if ((${#COMP_WORDS[@]} >= 2)); then
$func $cmd "${COMP_WORDS[${#COMP_WORDS[@]} - 1]}" "${COMP_WORDS[${#COMP_WORDS[@]} - 2]}"
$func $cmd "${COMP_WORDS[-1]}" "${COMP_WORDS[-2]}"
else
$func $cmd "${COMP_WORDS[${#COMP_WORDS[@]} - 1]}"
$func $cmd "${COMP_WORDS[-1]}"
fi

# restore initial compopts
Expand Down
2 changes: 1 addition & 1 deletion completions/route
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ _route()
for ((i = 1; i < ${#words[@]} - 1; i++)); do
[[ ${words[i]} == "$opt" ]] && found=true && break
done
$found || COMPREPLY[${#COMPREPLY[@]}]="$opt"
$found || COMPREPLY+=("$opt")
done

COMPREPLY=($(compgen -W '"${COMPREPLY[@]}"' -- "$cur"))
Expand Down

0 comments on commit 9994be6

Please sign in to comment.