]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/fstrim
Merge branch 'wipefs/improvements' of https://github.com/t-8ch/util-linux
[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="--all
19 --fstab
20 --listed-in
21 --quiet-unsupported
22 --offset
23 --length
24 --minimum
25 --types
26 --verbose
27 --dry-run
28 --help
29 --version"
30 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
31 return 0
32 ;;
33 esac
34 local MPOINTS
35 MPOINTS=$(findmnt -rno SOURCE,TARGET | awk '/^\/dev/{print $2}')
36 COMPREPLY=( $(compgen -W "$MPOINTS" -- $cur) )
37 return 0
38 }
39 complete -F _fstrim_module fstrim