19 lines
553 B
Bash
19 lines
553 B
Bash
_ctctl(){
|
|
local cur prev
|
|
_init_completion || return
|
|
|
|
case $prev in
|
|
auth|disconnect|render|fetch|prepare|load-conf|current|tokens|list|build|build-no-cache|exec|sh|logs|loki|conf)
|
|
return
|
|
;;
|
|
switch)
|
|
COMPREPLY=($(compgen -W "$(ls -1 ~/.ctctl/*/bashrc | xargs dirname | xargs basename -a)" -- "$cur"))
|
|
return
|
|
;;
|
|
esac
|
|
|
|
COMPREPLY=($(compgen -W 'auth switch current disconnect render fetch prepare load-conf tokens list build build-no-cache exec sh logs loki conf' -- "$cur"))
|
|
} &&
|
|
complete -F _ctctl ctctl
|
|
|