]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/mkfs
libfdisk: (docs) fix typos
[thirdparty/util-linux.git] / bash-completion / mkfs
1 _mkfs_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 '-t'|'--type')
9 FSTYPES=$(for I in /sbin/mkfs.* /usr/sbin/mkfs.*; do if [ -e $I ]; then echo ${I##*mkfs.}; fi; done)
10 COMPREPLY=( $(compgen -W "$FSTYPES" -- $cur) )
11 return 0
12 ;;
13 '-h'|'--help'|'-V'|'--version')
14 return 0
15 ;;
16 esac
17 case $cur in
18 -*)
19 OPTS='--type --verbose --help --version'
20 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
21 return 0
22 ;;
23 esac
24 compopt -o bashdefault -o default
25 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
26 return 0
27 }
28 complete -F _mkfs_module mkfs