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
|
# (C) 2011 magicant
# Completion script for the "git-format-patch" command.
# Supports Git 1.7.7.
function completion/git-format-patch {
WORDS=(git format-patch "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::format-patch:arg {
OPTIONS=( #>#
"--add-header:; specify an additional header string"
"--attach::; make patch contents an mail attachment"
"--cc:; specify an additional receiver"
"--cover-letter; create a file containing overall diffstat"
"--ignore-if-in-upstream"
"--inline::; like --attach, but use \"Content-Disposition: inline\""
"--in-reply-to:"
"k --keep-subject; don't add/remove \"[PATCH]\""
"--no-attach; cancel the --attach option"
"--no-binary; don't include diffs for binary files"
"p --no-stat; create plain patches without diffstats"
"N --no-numbered; name output in \"[PATCH]\" format"
"--no-signature; don't append a signature to results"
"--no-thread; don't thread mails"
"n --numbered; name output in \"[PATCH n/m]\" format"
"--numbered-files; use simple integers for output filenames"
"o: --output-directory:; specify the directory to place the results in"
"--quiet; don't print created patch filenames"
"--root; treat the operand as a revision range"
"--signature:; specify a signature appended to each message"
"s --signoff; include a signed-off-by line"
"--start-number:; specify a number to start numbering patches from"
"--stdout; output results to the standard output rather than files"
"--subject-prefix:; specify a string prefix to the subject"
"--suffix:; specify a suffix appended to result filenames"
"--thread::; specify mail threading behavior"
"--to:; specify an additional receiver"
) #<#
if command -vf completion/git::diff:getopt >/dev/null 2>&1 ||
. -AL completion/git-diff; then
command -f completion/git::diff:getopt
fi
command -f completion//parseoptions -n
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(--add-header)
;;
(--attach|--inline)
;;
(--in-reply-to)
;;
(o|--output-directory)
complete -P "$PREFIX" -S / -T -d
;;
(--signature)
;;
(--start-number)
;;
(--subject-prefix)
;;
(--suffix)
;;
(--to|--cc)
;;
('')
command -f completion/git::completeref range=true
;;
(*)
command -f completion/git::diff:compopt
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
|