sv on Artix has no completion script. While you can always run ls /run/runit/service and use the single-letter shortcuts (or even RSM), having a completion script would be a nice addition to the official runit/bash-completion package.
So far, I'm using Void's completion script (installed as an extra package, ran through with sed -i s@/var/@/run/runit/@g to be compatible with Artix):
https://raw.githubusercontent.com/void-linux/runit/master/completions/sv.bash
In case anyone is interested, I got around and uploaded this package to the AUR:
https://aur.archlinux.org/packages/runit-completion/
hey, thanks, exactly what i was looking for !
This page came up in first on startpage :D
the aur package does not exist anymore, but writing it to
/usr/share/bash-completion/completions/sv does the trick
and to be perfect, change the path
/var/service/ to
/run/runit/service/ to be able to autocomplete the name of the service
here is the final version to use:
# 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=( /run/runit/service/* )
COMPREPLY=( ${COMPREPLY[@]##*/} )
COMPREPLY=( $(compgen -W '${COMPREPLY[@]}' -- ${cur}) )
return
;;
esac
}
complete -F _sv sv
having the autocompletion is always nice :), so, shouldn't it be included in the runit installation ?
Just added it, avoid necroposting please.
great, thanks
@qontinuum :)
(sorry for necro posting, i thought it was better to answer here than an other post saying the same thing)