]>
Commit | Line | Data |
---|---|---|
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 |
0d71a259 | 20 | --quiet |
b8446f75 KZ |
21 | --offset |
22 | --length | |
23 | --minimum | |
24 | --verbose | |
5feae697 | 25 | --dry-run |
b8446f75 KZ |
26 | --help |
27 | --version" | |
c6f8c3f5 SK |
28 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
29 | return 0 | |
30 | ;; | |
31 | esac | |
32 | local MPOINTS | |
42f536ee | 33 | MPOINTS=$(findmnt -rno SOURCE,TARGET | awk '/^\/dev/{print $2}') |
c6f8c3f5 SK |
34 | COMPREPLY=( $(compgen -W "$MPOINTS" -- $cur) ) |
35 | return 0 | |
36 | } | |
37 | complete -F _fstrim_module fstrim |