3 local cur prev OPTS OUTPUT_ALL
5 OUTPUT_ALL="NR START END SECTORS SIZE NAME UUID TYPE FLAGS SCHEME"
6 cur="${COMP_WORDS[COMP_CWORD]}"
7 prev="${COMP_WORDS[COMP_CWORD-1]}"
13 local realcur prefix OUTPUT
15 prefix="${cur%$realcur}"
16 for WORD in $OUTPUT_ALL; do
17 if ! [[ $prefix == *"$WORD"* ]]; then
18 OUTPUT="$WORD ${OUTPUT:-""}"
22 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- $realcur) )
26 COMPREPLY=( $(compgen -W "size" -- $cur) )
30 COMPREPLY=( $(compgen -W "$(partx --list-types)" -- $cur) )
33 '-h'|'--help'|'-V'|'--version')
58 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
62 compopt -o bashdefault -o default
63 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
66 complete -F _partx_module partx