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