summaryrefslogtreecommitdiffstats
path: root/.gita-completion.bash
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:26:30 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-07-17 07:26:30 +0000
commitd6fb6e20014db80336431d38b9ee4d1ab233e905 (patch)
tree135e5a472dee94cbfeae03cc910d1e1732921e8c /.gita-completion.bash
parentAdding upstream version 0.12.9. (diff)
downloadgita-d6fb6e20014db80336431d38b9ee4d1ab233e905.tar.xz
gita-d6fb6e20014db80336431d38b9ee4d1ab233e905.zip
Adding upstream version 0.15.1.upstream/0.15.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '.gita-completion.bash')
-rw-r--r--.gita-completion.bash18
1 files changed, 12 insertions, 6 deletions
diff --git a/.gita-completion.bash b/.gita-completion.bash
index 5090bb7..493db05 100644
--- a/.gita-completion.bash
+++ b/.gita-completion.bash
@@ -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