2011-11-01 22:14:45 +02:00
|
|
|
# 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()
|
|
|
|
{
|
2011-04-20 22:22:51 +03:00
|
|
|
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
|
2009-11-22 11:43:26 +01:00
|
|
|
-C|-i|-m|-s|-S)
|
2009-10-04 19:42:50 +02:00
|
|
|
_filedir
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
-r)
|
|
|
|
_filedir -d
|
|
|
|
return 0
|
|
|
|
;;
|
2009-11-22 11:43:26 +01:00
|
|
|
-I|-D|-R)
|
2009-10-04 19:42:50 +02:00
|
|
|
# label completion
|
|
|
|
_lilo_labels
|
|
|
|
return 0
|
|
|
|
;;
|
2009-11-22 11:43:26 +01:00
|
|
|
-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-01 20:54:51 +03:00
|
|
|
|
2009-10-04 19:42:50 +02:00
|
|
|
# ex: ts=4 sw=4 et filetype=sh
|