61 lines
1.3 KiB
Plaintext
Raw Normal View History

2009-01-19 21:31:54 +01:00
# bash completion for mkinitrd
have mkinitrd &&
_mkinitrd()
{
2009-10-04 19:42:50 +02:00
local cur prev args split=false
COMPREPLY=()
cur=`_get_cword`
prev=${COMP_WORDS[COMP_CWORD-1]}
_split_longopt && split=true
case "$prev" in
--preload|--with|--builtin)
2009-10-04 19:42:50 +02:00
_modules
return 0
;;
--fstab|--dsdt)
2009-10-04 19:42:50 +02:00
_filedir
return 0
;;
--net-dev)
_available_interfaces
return 0
;;
esac
$split && return 0
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '--version --help -v -f --preload \
--force-scsi-probe --omit-scsi-modules \
--omit-ide-modules --image-version --force-raid-probe \
--omit-raid-modules --with --force-lvm-probe \
--omit-lvm-modules --builtin --omit-dmraid --net-dev \
--fstab --nocompress --dsdt --bootchart' -- "$cur" ) )
else
_count_args
case $args in
1)
_filedir
;;
2)
_kernel_versions
;;
esac
fi
2009-01-19 21:31:54 +01:00
} &&
complete -F _mkinitrd mkinitrd
# Local variables:
# mode: shell-script
2009-10-04 19:42:50 +02:00
# sh-basic-offset: 4
# sh-indent-comment: t
2009-10-04 19:42:50 +02:00
# indent-tabs-mode: nil
# End:
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh