1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
# (C) 2011 magicant
# Completion script for the "git-pull" command.
# Supports Git 1.7.7.
function completion/git-pull {
WORDS=(git pull "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::pull:arg {
OPTIONS=( #>#
"--no-rebase; cancel the --rebase option"
"q --quiet; don't report progress"
"--rebase; rebase the current branch instead of merging"
"v --verbose" # TODO description
) #<#
if command -vf completion/git::fetch:getopt >/dev/null 2>&1 ||
. -AL completion/git-fetch; then
command -f completion/git::fetch:getopt
fi
if command -vf completion/git::merge:getopt >/dev/null 2>&1 ||
. -AL completion/git-merge; then
command -f completion/git::merge:getopt
fi
command -f completion//parseoptions
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(--recurse-submodules|--upload-pack)
command -f completion/git::$ARGOPT:arg
;;
# (--depth)
# ;;
('')
command -f completion//getoperands
if [ ${WORDS[#]} -eq 0 ]; then
#TODO complete remote URI
command -f completion/git::completeremote
elif [ "${WORDS[-1]}" = tag ]; then
command -f completion/git::completeref --tags
else
typeset word="${TARGETWORD#"$PREFIX"}"
word=${word#+}
case $word in
(*:*) # complete local refs
word=${word#*:}
PREFIX=${TARGETWORD%"$word"}
command -f completion/git::completeref
;;
(*) # complete remote refs
PREFIX=${TARGETWORD%"$word"}
command -f completion/git::completeremoteref "${WORDS[1]}"
;;
esac
fi
;;
(*)
command -f completion/git::merge:compopt
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
|