]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/fstrim
tests: add /mnt/test/foo^Mbar to mountinfo tests
[thirdparty/util-linux.git] / bash-completion / fstrim
CommitLineData
c6f8c3f5
SK
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 ;;
d4f9b8d7
VS
12 '-h'|'--help'|'-V'|'--version')
13 return 0
14 ;;
c6f8c3f5
SK
15 esac
16 case $cur in
17 -*)
b8446f75 18 OPTS="--all
5feae697 19 --fstab
b8446f75
KZ
20 --offset
21 --length
22 --minimum
23 --verbose
5feae697 24 --dry-run
b8446f75
KZ
25 --help
26 --version"
c6f8c3f5
SK
27 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
28 return 0
29 ;;
30 esac
31 local MPOINTS
42f536ee 32 MPOINTS=$(findmnt -rno SOURCE,TARGET | awk '/^\/dev/{print $2}')
c6f8c3f5
SK
33 COMPREPLY=( $(compgen -W "$MPOINTS" -- $cur) )
34 return 0
35}
36complete -F _fstrim_module fstrim