5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
8 '-d'|'--dump'|'-J'|'--json'|'-l'|'--list'|'-F'|'--list-free'|'-r'|'--reorder'|'-s'|'--show-size'|'-V'|'--verify'|'-A'|'--activate'|'--delete')
9 compopt -o bashdefault -o default
10 COMPREPLY=( $(compgen -W "$(lsblk -dpnro name)" -- $cur) )
14 COMPREPLY=( $(compgen -W "number" -- $cur) )
17 '--color'|'-w'|'--wipe'|'-W'|'--wipe-partitions')
18 COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
22 local prefix realcur OUTPUT_ALL OUTPUT
24 prefix="${cur%$realcur}"
26 Attrs Boot Bsize Cpg Cylinders Device End
27 End-C/H/S Flags Fsize Id Name Sectors Size
28 Slice Start Start-C/H/S Type Type-UUID UUID
30 for WORD in $OUTPUT_ALL; do
31 if ! [[ $prefix == *"$WORD"* ]]; then
32 OUTPUT="$WORD ${OUTPUT:-""}"
36 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") )
42 COMPREPLY=( $(compgen -f -- $cur) )
45 '-h'|'--help'|'-v'|'--version')
90 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
94 compopt -o bashdefault -o default
95 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
98 complete -F _sfdisk_module sfdisk