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-tag" command.
# Supports Git 1.7.7.
function completion/git-tag {
WORDS=(git tag "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::tag:arg {
OPTIONS=( #>#
"a; make an unsigned annotated tag"
"--contains:; list tags that are ancestors of the specified commit"
"d; delete tags"
"F:; specify a file containing the message"
"f --force; overwrite an existing tag"
"l; list tag names that match an operand"
"m:; specify the message"
"n::; specify the number of lines of annotation to print"
"s; make a GPG-signed tag with the default email address's key"
"u:; specify a key to make a GPG-signed tag with"
"v; verify tags"
) #<#
command -f completion//parseoptions -n
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(--contains)
command -f completion/git::completeref
;;
('')
typeset i=2 nomake=false
while [ $i -le ${WORDS[#]} ]; do
case ${WORDS[i]} in
(--)
i=$((i+1))
break
;;
(--*)
i=$((i+1))
;;
(-*[dlv]*)
nomake=true
break
;;
(-?*)
i=$((i+1))
;;
(*)
break
;;
esac
done
if $nomake || [ $i -gt ${WORDS[#]} ]; then
command -f completion/git::completeref --tags
else
command -f completion/git::completeref
fi
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
|