Add bash completion script

This commit is contained in:
Russell Hernandez Ruiz 2021-11-15 16:36:32 -06:00
parent 8c32909a15
commit d6e2f66482
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
function _abduco() {
case $2 in
-*) # Option
COMPREPLY=($(compgen -W ' \
-n -nf \
-c -cf -cr \
-f -fn -fc -fcr \
-A -Ar \
-a -ar \
-l -lr \
-r -rc -rcf -rA -ra -rl \
-e -e^ \
-v \
' -- $2))
;;
*) # Session
local sessions=$(abduco | tail -n+2 | cut -f 3)
COMPREPLY=($(compgen -W $sessions -- $2))
[ -n "$2" ] && compopt -o plusdirs
;;
esac
}
command -F _abduco abduco