]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/blkzone
fstrim shouldn't run inside a container
[thirdparty/util-linux.git] / bash-completion / blkzone
CommitLineData
6324d0f4
KZ
1_blkzone_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')
9 COMPREPLY=( $(compgen -W "sector" -- $cur) )
10 return 0
11 ;;
12 '-l'|'--length')
13 COMPREPLY=( $(compgen -W "size" -- $cur) )
14 return 0
15 ;;
83004321
KZ
16 '-c'|'--count')
17 COMPREPLY=( $(compgen -W "number" -- $cur) )
18 return 0
19 ;;
6324d0f4
KZ
20 '-h'|'--help'|'-V'|'--version')
21 return 0
22 ;;
23 esac
24 case $cur in
25 -*)
26 case $prev in
27 'report'|'reset')
83004321 28 OPTS="--verbose --offset --length --count"
6324d0f4
KZ
29 ;;
30 *)
31 OPTS="--help --version"
32 ;;
33 esac
34 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
35 return 0
36 ;;
37 *)
38 case $prev in
39 'report'|'reset')
40 ;;
41 *)
42 OPTS="report reset"
43 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
44 ;;
45 esac
46 return 0
47 ;;
48 esac
49 COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
50 return 0
51}
52complete -F _blkzone_module blkzone