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 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
|
# (C) 2011-2025 magicant
# Completion script for the "git-tag" command.
# Supports Git 2.48.1.
function completion/git-tag {
WORDS=(git tag "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::tag:arg {
OPTIONS=( #>#
"a --annotate; make an unsigned annotated tag"
"--cleanup:; specify the way the message is cleaned up"
"--color::; show in color"
"--column::; columnize output"
"--contains:; list tags that are ancestors of the specified commit"
"--create-reflog; enable reflog for the new tag"
"d --delete; delete tags"
"e --edit; edit the tag message"
"F: --file:; specify a file containing the message"
"f --force; overwrite an existing tag"
"--format:; specify an output format"
"i --ignore-case; sort and filter tags case-insensitively"
"l --list; list tag names that match an operand"
"u: --local-user:; specify a key to make a GPG-signed tag with"
"m: --message:; specify the message"
"--merged:; list tags that are descendants of the specified commit"
"n::; specify the number of lines of annotation to print"
"--no-column; print tags line by line"
"--no-contains:; list tags that are not ancestors of the specified commit"
"--no-merged:; list tags that are not descendants of the specified commit"
"--no-sign; don't GPG-sign the tag"
"--omit-empty; don't print empty items"
"--points-at:; list tags that point at the specified commit"
"s --sign; make a GPG-signed tag with the default email address's key"
"--sort:; sort listed tags"
"--trailer:; specify token-value pair to append to the message"
"v --verify; verify the GPG signature of tags"
) #<#
command -f completion//parseoptions -n
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(--cleanup|--color|--column|--format|--sort)
command -f completion/git::$ARGOPT:arg
;;
(--contains)
command -f completion/git::completeref
;;
('')
typeset i=2 nomake=false
while [ $i -le ${WORDS[#]} ]; do
case ${WORDS[i]} in
(--)
i=$((i+1))
break
;;
(--contains|--delete|--list|--merged| \
--no-contains|--no-merged|--points-at|--verify)
nomake=true
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 et:
|