diff options
Diffstat (limited to 'completions/lilo')
-rw-r--r-- | completions/lilo | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/completions/lilo b/completions/lilo index af8539a..6df8566 100644 --- a/completions/lilo +++ b/completions/lilo @@ -1,66 +1,63 @@ # bash completion for lilo(8) -*- shell-script -*- -_lilo_labels() +_comp_cmd_lilo__labels() { - COMPREPLY=($(compgen -W "$(awk -F= '$1 ~ /^[ \t]*label$/ {print $2}' \ - ${1:-/etc/lilo.conf} 2>/dev/null | command sed -e 's/\"//g')" \ - -- "$cur")) + _comp_compgen_split -- "$(_comp_awk -F = '$1 ~ /^[ \t]*label$/ {print $2}' \ + "${1:-/etc/lilo.conf}" 2>/dev/null | command sed -e 's/\"//g')" } -_lilo() +_comp_cmd_lilo() { - local cur prev words cword - _init_completion || return + local cur prev words cword comp_args + _comp_initialize -- "$@" || return case $prev in -C | -i | -m | -s | -S) - _filedir + _comp_compgen_filedir return ;; -r) - _filedir -d + _comp_compgen_filedir -d return ;; -I | -D | -R) # label completion - local i conf + local i conf="" for i in "${!words[@]}"; do if [[ ${words[i]} == -C ]]; then - conf=${words[i + 1]} + conf=${words[i + 1]-} break fi done - _lilo_labels $conf + _comp_cmd_lilo__labels "$conf" return ;; -A | -b | -M | -u | -U) # device completion - cur=${cur:=/dev/} - _filedir + _comp_compgen -c "${cur:-/dev/}" filedir return ;; -T) # topic completion - COMPREPLY=($(compgen -W 'help ChRul EBDA geom geom= table= - video' -- "$cur")) + _comp_compgen -- -W 'help ChRul EBDA geom geom= table= video' return ;; -B) - _filedir bmp + _comp_compgen_filedir bmp return ;; -E) - _filedir '@(bmp|dat)' + _comp_compgen_filedir '@(bmp|dat)' return ;; esac if [[ $cur == -* ]]; then # relevant options completion - COMPREPLY=($(compgen -W '-A -B -b -c -C -d -E -f -g -i -I -l -L -m -M - -p -P -q -r -R -s -S -t -T -u -U -v -V -w -x -z' -- "$cur")) + _comp_compgen -- -W '-A -B -b -c -C -d -E -f -g -i -I -l -L -m -M -p -P + -q -r -R -s -S -t -T -u -U -v -V -w -x -z' fi } && - complete -F _lilo lilo + complete -F _comp_cmd_lilo lilo # ex: filetype=sh |