diff options
-rw-r--r-- | debian/bash_completion.d/git-phab | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/debian/bash_completion.d/git-phab b/debian/bash_completion.d/git-phab index 6603f72..e9a3ea5 100644 --- a/debian/bash_completion.d/git-phab +++ b/debian/bash_completion.d/git-phab @@ -1,7 +1,22 @@ -function _git_phab() -{ - COMP_WORDS=(git-phab ${COMP_WORDS[@]:2}) - COMP_CWORD=$((COMP_CWORD - 1)) - COMP_LINE=${COMP_LINE/git phab/git-phab} - _python_argcomplete_global git-phab +_git_phab() { + local IFS=$'\013' + local SUPPRESS_SPACE=0 + if compopt +o nospace 2> /dev/null; then + SUPPRESS_SPACE=1 + fi + COMPREPLY=( $(IFS="$IFS" \ + COMP_LINE="${COMP_LINE/git phab/git-phab}" \ + COMP_POINT="$COMP_POINT" \ + COMP_TYPE="$COMP_TYPE" \ + _ARGCOMPLETE_COMP_WORDBREAKS="$COMP_WORDBREAKS" \ + _ARGCOMPLETE=1 \ + _ARGCOMPLETE_SUPPRESS_SPACE=$SUPPRESS_SPACE \ + git-phab 8>&1 9>&2 1>/dev/null 2>/dev/null) ) + if [[ $? != 0 ]]; then + unset COMPREPLY + elif [[ $SUPPRESS_SPACE == 1 ]] && [[ "$COMPREPLY" =~ [=/:]$ ]]; then + compopt -o nospace + fi +} +complete -o nospace -o default -F _git_phab "git-phab" |