56 lines
1014 B
Plaintext
Raw Normal View History

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