Merging upstream version 0.15.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
86d5d7fe9f
commit
9cbf6c15e9
22 changed files with 1805 additions and 372 deletions
|
@ -7,30 +7,36 @@ _gita_completions()
|
|||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
cmd=${COMP_WORDS[1]}
|
||||
|
||||
# FIXME: this is somewhat slow
|
||||
commands=`gita -h | sed '2q;d' |sed 's/[{}.,]/ /g'`
|
||||
|
||||
repos=`gita ls`
|
||||
# this doesn't work for two repos with the same basename
|
||||
#gita_path=${XDG_CONFIG_HOME:-$HOME/.config}/gita/repo_path
|
||||
#repos=`awk '{split($0, paths, ":")} END {for (i in paths) {n=split(paths[i],b, /\//); print b[n]}}' ${gita_path}`
|
||||
|
||||
if [ $COMP_CWORD -eq 1 ]; then
|
||||
# FIXME: this is somewhat slow
|
||||
commands=`gita -h | sed '2q;d' |sed 's/[{}.,]/ /g'`
|
||||
COMPREPLY=($(compgen -W "${commands}" ${cur}))
|
||||
elif [ $COMP_CWORD -gt 1 ]; then
|
||||
case $cmd in
|
||||
add)
|
||||
COMPREPLY=($(compgen -d ${cur}))
|
||||
;;
|
||||
ll)
|
||||
clone)
|
||||
COMPREPLY=($(compgen -f ${cur}))
|
||||
;;
|
||||
color | flags)
|
||||
COMPREPLY=($(compgen -W "ll set" ${cur}))
|
||||
;;
|
||||
ll | context)
|
||||
groups=`gita group ls`
|
||||
COMPREPLY=($(compgen -W "${groups}" ${cur}))
|
||||
return
|
||||
;;
|
||||
*)
|
||||
repos=`gita ls`
|
||||
COMPREPLY=($(compgen -W "${repos}" ${cur}))
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
complete -F _gita_completions gita
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue