mirror of
https://github.com/spf13/cobra
synced 2024-11-24 14:47:12 +00:00
Do not add a space after a single flag completion (#625)
This commit is contained in:
parent
be77323fc0
commit
1a618fb24b
1 changed files with 6 additions and 0 deletions
|
@ -136,6 +136,12 @@ __%[1]s_handle_reply()
|
||||||
if declare -F __ltrim_colon_completions >/dev/null; then
|
if declare -F __ltrim_colon_completions >/dev/null; then
|
||||||
__ltrim_colon_completions "$cur"
|
__ltrim_colon_completions "$cur"
|
||||||
fi
|
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"
|
# The arguments should be in the form "ext1|ext2|extn"
|
||||||
|
|
Loading…
Reference in a new issue