5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
9 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
13 COMPREPLY=( $(compgen -W "512 1024 2048 4096" -- $cur) )
16 '-c'|'--compatibility')
17 COMPREPLY=( $(compgen -W "dos nondos" -- $cur) )
21 COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
25 local prefix realcur OUTPUT_ALL OUTPUT
27 prefix="${cur%$realcur}"
50 for WORD in $OUTPUT_ALL; do
51 if ! [[ $prefix == *"$WORD"* ]]; then
52 OUTPUT="$WORD ${OUTPUT:-""}"
56 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") )
60 COMPREPLY=( $(compgen -W "cylinders sectors" -- $cur) )
63 '-C'|'--cylinders'|'-H'|'--heads'|'-S'|'--sectors')
64 COMPREPLY=( $(compgen -W "number" -- $cur) )
67 '-h'|'--help'|'-v'|'--version'|'-V'|'--list')
90 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
94 compopt -o bashdefault -o default
95 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
98 complete -F _fdisk_module fdisk