diff --git a/completion/available/hub.completion.bash b/completion/available/hub.completion.bash index 3e99aca7..bd84d322 100644 --- a/completion/available/hub.completion.bash +++ b/completion/available/hub.completion.bash @@ -1,6 +1,11 @@ # hub tab-completion script for bash. # This script complements the completion script that ships with git. +# If there is no git tab completion, but we have the _completion loader try to load it +if ! declare -F _git > /dev/null && declare -F _completion_loader > /dev/null; then + _completion_loader git +fi + # Check that git tab completion is available if declare -F _git > /dev/null; then # Duplicate and rename the 'list_all_commands' function @@ -225,13 +230,13 @@ EOF fi } - # hub pull-request [-f] [-m |-F |-i |] [-b ] [-h ] + # hub pull-request [-f] [-m |-F |-i |] [-b ] [-h ] [-a ] [-M ] [-l ] _git_pull_request() { - local i c=2 flags="-f -m -F -i -b -h" + local i c=2 flags="-f -m -F -i -b -h -a -M -l" while [ $c -lt $cword ]; do i="${words[c]}" case "$i" in - -m|-F|-i|-b|-h) + -m|-F|-i|-b|-h|-a|-M|-l) ((c++)) flags=${flags/$i/} ;; @@ -245,7 +250,7 @@ EOF -i) COMPREPLY=() ;; - -b|-h) + -b|-h|-a|-M|-l) # (Doesn't seem to need this...) # Uncomment the following line when 'owner/repo:[TAB]' misbehaved #_get_comp_words_by_ref -n : cur