Skip to content

Commit

Permalink
Do not add a space after a single flag completion (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
eparis authored Feb 21, 2018
1 parent be77323 commit 1a618fb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bash_completions.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@ __%[1]s_handle_reply()
if declare -F __ltrim_colon_completions >/dev/null; then
__ltrim_colon_completions "$cur"
fi
# If there is only 1 completion and it is a flag with an = it will be completed
# but we don't want a space after the =
if [[ "${#COMPREPLY[@]}" -eq "1" ]] && [[ $(type -t compopt) = "builtin" ]] && [[ "${COMPREPLY[0]}" == --*= ]]; then
compopt -o nospace
fi
}
# The arguments should be in the form "ext1|ext2|extn"
Expand Down

0 comments on commit 1a618fb

Please sign in to comment.