2022-06-09 13:53:09 +02:00
|
|
|
# bash completion for runit sv(1)
|
|
|
|
|
|
|
|
_sv()
|
|
|
|
{
|
|
|
|
local cur prev words cword commands
|
|
|
|
_init_completion || return
|
|
|
|
|
|
|
|
commands='up down status once pause cont hup alarm interrupt 1 2 term kill exit start stop restart shutdown force-stop force-reload force-restart force-shutdown'
|
|
|
|
|
|
|
|
case $prev in
|
|
|
|
-w)
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
-* | sv)
|
|
|
|
COMPREPLY=( $(compgen -W "${commands}" -- ${cur}) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
COMPREPLY=( /var/service/* )
|
|
|
|
COMPREPLY+=( /home/hendrik/sv/* )
|
|
|
|
COMPREPLY=( ${COMPREPLY[@]##*/} )
|
2022-07-12 16:59:32 +02:00
|
|
|
COMPREPLY=( "${COMPREPLY[@]/README.md}" )
|
2022-06-09 13:53:09 +02:00
|
|
|
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- ${cur}) )
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
complete -F _sv sv
|