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
|
# (C) 2011-2025 magicant
# Completion script for the "git-init" command.
# Supports Git 2.48.1.
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"
"b: --initial-branch:; specify the initial branch name"
"--object-format:; specify a hash algorithm for objects"
"q --quiet; print error and warning messages only"
"--ref-format:; specify a ref storage format"
"--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
(--object-format) #>>#
complete -P "$PREFIX" sha1 sha256
;; #<<#
(--ref-format)
command -f completion/git::--ref-format:arg
;;
(--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 et:
|