3 local cur prev OPTS OUTPUT_ALL
6 cur="${COMP_WORDS[COMP_CWORD]}"
7 prev="${COMP_WORDS[COMP_CWORD-1]}"
12 COMPREPLY=( $(compgen -f -- $cur) )
16 COMPREPLY=( $(compgen -W "value device export full" -- $cur) )
20 COMPREPLY=( $(compgen -W "tag" -- $cur) )
24 COMPREPLY=( $(compgen -W "TYPE= LABEL= UUID=" -- $cur) )
28 COMPREPLY=( $(compgen -W "$(cd /dev/disk/by-label/ 2>/dev/null && echo *)" -- $cur) )
32 COMPREPLY=( $(compgen -W "$(cd /dev/disk/by-uuid/ 2>/dev/null && echo *)" -- $cur) )
36 COMPREPLY=( $(compgen -W "size" -- $cur) )
40 COMPREPLY=( $(compgen -W "offset" -- $cur) )
44 OUTPUT_ALL={,no}{filesystem,raid,crypto,other}
48 $(awk '{print $NF}' /proc/filesystems)
49 $(\ls /lib/modules/$(uname -r)/kernel/fs)
52 '-h'|'--help'|'-V'|'--version')
56 if [ -n "$OUTPUT_ALL" ]; then
57 local prefix realcur OUTPUT_ALL OUTPUT
59 prefix="${cur%$realcur}"
60 for WORD in $OUTPUT_ALL; do
61 if ! [[ $prefix == *"$WORD"* ]]; then
62 OUTPUT="$WORD ${OUTPUT:-""}"
66 COMPREPLY=( $(compgen -P "$prefix" -W "$OUTPUT" -S ',' -- "$realcur") )
92 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
96 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
99 complete -F _blkid_module blkid