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
|
# (C) 2011 magicant
# Completion script for the "git-init" command.
# Supports Git 1.7.7.
function completion/git-init {
WORDS=(git init "${WORDS[2,-1]}")
command -f completion//reexecute
}
function completion/git::init:arg {
OPTIONS=( #>#
"--bare; create a bare repository"
"q --quiet; print error and warning messages only"
"--separate-git-dir:; specify the repository directory"
"--shared::; share the repository with other users"
"--template:; specify a directory that contains templates"
) #<#
command -f completion//parseoptions -n
case $ARGOPT in
(-)
command -f completion//completeoptions
;;
('')
complete -P "$PREFIX" -S / -T -d
;;
(*)
command -f completion/git::init:compopt
;;
esac
}
function completion/git::init:compopt
case $ARGOPT in
(--shared) #>>#
complete -P "$PREFIX" -D "set permissions according to the current umask" umask false
complete -P "$PREFIX" -D "make the repository group-writable" group true
complete -P "$PREFIX" -D "make the repository world-writable" all world everybody
;; #<<#
(--separate-git-dir|--template)
complete -P "$PREFIX" -S / -T -d
;;
(*)
return 1
;;
esac
# vim: set ft=sh ts=8 sts=8 sw=8 noet:
|