supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* bash completion for sv
@ 2007-10-18 20:52 Sascha Hüdepohl
  0 siblings, 0 replies; only message in thread
From: Sascha Hüdepohl @ 2007-10-18 20:52 UTC (permalink / raw)
  To: supervision

[-- Attachment #1: Type: text/plain, Size: 218 bytes --]

Hi!

I wrote a little bash completion script for sv. Maybe someone finds it
usefull.

To use it, copy the attached script to a directory you like and add a
line like: 
. <path>/script
to your ~/.bashrc

regards
sascha

[-- Attachment #2: sv_completion --]
[-- Type: text/plain, Size: 370 bytes --]

# vim:ft=sh

shopt -s extglob

_svcomp() {
  local cur
  cur=${COMP_WORDS[COMP_CWORD]}

  COMPREPLY=()

  if [ $COMP_CWORD -eq 1 ]; then
    COMPREPLY=( $( compgen -W 'status up down once pause cont hup alarm interrupt quit 1 2 term kill exit' -- $cur ) )
  else
    COMPREPLY=( $( compgen -W "$(ls /var/service/)" -- $cur ) )
  fi

  return 0
}

complete -F _svcomp sv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-10-18 20:52 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-18 20:52 bash completion for sv Sascha Hüdepohl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).