/
githubmirror
/
bash-completion
Обзор
Документация
Войти
/
githubmirror
/
bash-completion
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
1.90
completions/service
34 строки
1013 B
Ville Skyttä
Move Emacs indentation settings from every file to .dir-locals.el.
02 ноя 2011, 00:14
02 ноя 2011, 00:14
0d10b94
Код
Авторство
О чём код?
# service(8) and /etc/init.d/* completion -*- shell-script -*- # This completes on a list of all available service scripts for the # 'service' command and/or the SysV init.d directory, followed by # that script's available commands _service() { local cur prev words cword _init_completion || return # don't complete past 2nd token [ $cword -gt 2 ] && return 0 if [[ $cword -eq 1 && $prev == ?(*/)service ]]; then _services else local sysvdir [ -d /etc/rc.d/init.d ] && \ sysvdir=/etc/rc.d/init.d || sysvdir=/etc/init.d COMPREPLY=( $( compgen -W '`sed -e "y/|/ /" \ -ne "s/^.*\(U\|msg_u\)sage.*{\(.*\)}.*$/\2/p" \ $sysvdir/${prev##*/} 2>/dev/null` start stop' -- "$cur" ) ) fi return 0 } && complete -F _service service for svc in /etc/init.d/!($_backup_glob) /etc/rc.d/init.d/!($_backup_glob); do [ -x "$svc" ] && complete -F _service $svc done unset svc # ex: ts=4 sw=4 et filetype=sh