2013-03-22 23:37:11 +00:00
|
|
|
_addpart_module()
|
|
|
|
{
|
2015-06-02 23:59:03 +06:00
|
|
|
local cur
|
2013-03-22 23:37:11 +00:00
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
case $COMP_CWORD in
|
|
|
|
1)
|
2014-10-26 22:07:08 +00:00
|
|
|
OPTS="--help --version $(lsblk -pnro name)"
|
2019-09-19 07:45:54 -06:00
|
|
|
compopt -o bashdefault -o default
|
2013-03-22 23:37:11 +00:00
|
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
|
|
;;
|
|
|
|
2)
|
|
|
|
# FIXME: how to determine next free partition number
|
|
|
|
;;
|
|
|
|
3)
|
|
|
|
COMPREPLY=( $(compgen -W "start" -- $cur) )
|
|
|
|
;;
|
|
|
|
4)
|
|
|
|
COMPREPLY=( $(compgen -W "length" -- $cur) )
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _addpart_module addpart
|