| cur="${COMP_WORDS[COMP_CWORD]}" |
| prev="${COMP_WORDS[COMP_CWORD-1]}" |
| COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) |
| COMPREPLY=( $(compgen -W "512 1024 2048 4096" -- $cur) ) |
| COMPREPLY=( $(compgen -W "dos nondos" -- $cur) ) |
| COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) |
| local prefix realcur OUTPUT_ALL OUTPUT |
| for WORD in $OUTPUT_ALL; do |
| if ! [[ $prefix == *"$WORD"* ]]; then |
| OUTPUT="$WORD ${OUTPUT:-""}" |
| COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") ) |
| COMPREPLY=( $(compgen -W "cylinders sectors" -- $cur) ) |
| '-C'|'--cylinders'|'-H'|'--heads'|'-S'|'--sectors') |
| COMPREPLY=( $(compgen -W "number" -- $cur) ) |
| '-h'|'--help'|'-v'|'--version'|'-V'|'--list') |
| COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
| COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) ) |
| complete -F _fdisk_module fdisk |