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
|
# (C) 2016 magicant
# Completion script for the "git-rev-parse" command.
# Supports Git 2.9.2.
function completion/git-rev-parse {
WORDS=(git rev-parse "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::rev-parse:arg {
OPTIONS=( #>#
"--abbrev-ref::; print in short object names"
"--after: --since:; convert the specified date to --max-age timestamp"
"--before: --until:; convert the specified date to --mim-age timestamp"
"--default; specify a default argument"
"--disambiguate:; show all SHA-1 values that start with the specified prefix"
"--flags; print options only"
"--git-common-dir; print the main repository path"
"--git-dir; print the repository path"
"--git-path; resolve a path inside the repository"
"--is-bare-repository; test if the repository is bare"
"--is-inside-git-dir; test if the current directory is inside a repository"
"--is-inside-work-tree; test if the current directory is inside a working tree"
"--keep-dashdash"
"--local-env-vars; print repository-local environment variables"
"--no-flags; print operands only"
"--no-revs; ignore arguments meant for rev-list"
"--not; negate printed object names"
"--parseopt; enable option parsing mode"
"--prefix; specify a directory to operate in"
"q --quiet; don't print any error message (with --verify)"
"--resolve-git-dir; test if the operand is a repository path"
"--revs-only; ignore arguments not meant for rev-list"
"--shared-index-path; print the shared index file path"
"--short::; abbreviate printed SHA-1 values"
"--show-cdup; print a relative path to the top-level directory"
"--show-prefix; print a relative path from the top-level directory"
"--show-toplevel; print the absolute path of the top-level directory"
"--sq; print with shell-friendly quotation"
"--sq-quote; enable shell quoting mode"
"--stop-at-non-option"
"--stuck-long"
"--symbolic; keep operands symbolic"
"--symbolic-full-name; convert refs into full names"
"--verify; verify if the operand names a valid object"
) #<#
command -f completion/git::getrefselectopts
command -f completion//parseoptions -n
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
(--disambiguate)
;;
(--abbrev-ref) #>>#
complete -P "$PREFIX" -D "allow ambiguous names" loose
complete -P "$PREFIX" -D "ensure unambiguous names" strict
;; #<<#
('')
command -f completion/git::completerefpath range=true
;;
(*)
command -f completion/git::completerefselectopts
;;
esac
}
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
|