]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/wipefs
bash-completion: Don't offer any more completions after help or version.
[thirdparty/util-linux.git] / bash-completion / wipefs
1 _wipefs_module()
2 {
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-o'|'--offset')
9 COMPREPLY=( $(compgen -W "offset" -- $cur) )
10 return 0
11 ;;
12 '-t'|'--types')
13 local TYPES
14 TYPES="$(blkid -k)"
15 COMPREPLY=( $(compgen -W "$TYPES" -- $cur) )
16 return 0
17 ;;
18 '-h'|'--help'|'-V'|'--version')
19 return 0
20 ;;
21 esac
22 case $cur in
23 -*)
24 OPTS="-a --all -f --force -h --help -n --no-actn -o --offset -p --parsable -q --quiet -t --types -V --version"
25 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
26 return 0
27 ;;
28 esac
29 local DEVS
30 DEVS=''; while read dev; do DEVS+="$dev " ; done < <(lsblk -pnro name)
31 COMPREPLY=( $(compgen -W "$DEVS" -- $cur) )
32 return 0
33 }
34 complete -F _wipefs_module wipefs