]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/fstrim
bash-completion: Don't offer any more completions after help or version.
[thirdparty/util-linux.git] / bash-completion / fstrim
1 _fstrim_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'|'-l'|'--length'|'-m'|'--minimum')
9 COMPREPLY=( $(compgen -W "num" -- $cur) )
10 return 0
11 ;;
12 '-h'|'--help'|'-V'|'--version')
13 return 0
14 ;;
15 esac
16 case $cur in
17 -*)
18 OPTS="-o --offset -l --length -m --minimum -v --verbose -h --help -V --version"
19 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
20 return 0
21 ;;
22 esac
23 local MPOINTS
24 MPOINTS=$(findmnt -rno SOURCE | grep ^/dev)
25 COMPREPLY=( $(compgen -W "$MPOINTS" -- $cur) )
26 return 0
27 }
28 complete -F _fstrim_module fstrim