| 1 |
_addpart_module() |
| 2 |
{ |
| 3 |
local cur |
| 4 |
COMPREPLY=() |
| 5 |
cur="${COMP_WORDS[COMP_CWORD]}" |
| 6 |
case $COMP_CWORD in |
| 7 |
1) |
| 8 |
OPTS="--help --version $(command lsblk -pnro name)" |
| 9 |
compopt -o bashdefault -o default |
| 10 |
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
| 11 |
;; |
| 12 |
2) |
| 13 |
# FIXME: how to determine next free partition number |
| 14 |
;; |
| 15 |
3) |
| 16 |
COMPREPLY=( $(compgen -W "start" -- $cur) ) |
| 17 |
;; |
| 18 |
4) |
| 19 |
COMPREPLY=( $(compgen -W "length" -- $cur) ) |
| 20 |
;; |
| 21 |
esac |
| 22 |
return 0 |
| 23 |
} |
| 24 |
complete -F _addpart_module addpart |