51 lines
1.2 KiB
Plaintext
Raw Normal View History

# bash completion for lilo(8) -*- shell-script -*-
2009-05-25 22:52:00 +03:00
_lilo_labels()
{
2009-10-04 19:42:50 +02:00
COMPREPLY=( $( compgen -W "$( awk -F'=' '/label/ {print $2}' \
/etc/lilo.conf | sed -e 's/\"//g' )" -- "$cur" ) )
2009-05-25 22:52:00 +03:00
}
_lilo()
{
local cur prev words cword
_init_completion || return
2009-05-25 22:52:00 +03:00
2009-10-04 19:42:50 +02:00
case $prev in
-C|-i|-m|-s|-S)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
-r)
_filedir -d
return 0
;;
-I|-D|-R)
2009-10-04 19:42:50 +02:00
# label completion
_lilo_labels
return 0
;;
-A|-b|-M|-u|-U)
2009-10-04 19:42:50 +02:00
# device completion
cur=${cur:=/dev/}
_filedir
return 0
;;
-T)
# topic completion
COMPREPLY=( $( compgen -W 'help ChRul EBDA geom geom= \
table= video' -- "$cur" ) )
return 0
;;
esac
2009-05-25 22:52:00 +03:00
2009-10-04 19:42:50 +02:00
if [[ "$cur" == -* ]]; then
# relevant options completion
COMPREPLY=( $( compgen -W '-A -b -c -C -d -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" ) )
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-25 22:52:00 +03:00
complete -F _lilo lilo
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh