c875723bef
This way it's clearer to users that an argument is expected. It's likely that this commit does not catch all such cases, but it should do it for most of the affected commands I have installed.
59 lines
1.3 KiB
Bash
59 lines
1.3 KiB
Bash
# bash completion for mkinitrd
|
|
|
|
have mkinitrd || return
|
|
|
|
_mkinitrd()
|
|
{
|
|
local cur prev words cword split
|
|
_init_completion -s || return
|
|
|
|
case $prev in
|
|
--preload|--with|--builtin)
|
|
_modules
|
|
return 0
|
|
;;
|
|
--fstab|--dsdt)
|
|
_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" ) )
|
|
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
|
else
|
|
local args
|
|
_count_args
|
|
|
|
case $args in
|
|
1)
|
|
_filedir
|
|
;;
|
|
2)
|
|
_kernel_versions
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
} &&
|
|
complete -F _mkinitrd mkinitrd
|
|
|
|
# Local variables:
|
|
# mode: shell-script
|
|
# sh-basic-offset: 4
|
|
# sh-indent-comment: t
|
|
# indent-tabs-mode: nil
|
|
# End:
|
|
# ex: ts=4 sw=4 et filetype=sh
|