]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/blockdev
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / blockdev
CommitLineData
bf60993c
SK
1_blockdev_module()
2{
3 local cur prev OPTS
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
53154dae 7 DEVS="$(lsblk -pnro name)"
bf60993c
SK
8 OPTS="-h -V -q
9 --report
10 --getsz
11 --setro
12 --setrw
13 --getro
14 --getdiscardzeroes
15 --getss
16 --getpbsz
17 --getiomin
18 --getioopt
19 --getalignoff
20 --getmaxsect
21 --getbsz
39d2e706 22 --setbsz
bf60993c
SK
23 --getsize64
24 --setra
25 --getra
26 --setfra
27 --getfra
28 --flushbufs
29 --rereadpt
30 $DEVS"
31 case $prev in
39d2e706
KZ
32 '--setbsz')
33 COMPREPLY=( $(compgen -W "bytes" -- $cur) )
34 return 0
35 ;;
27ea4deb 36 '--setra'|'--setfra')
bf60993c
SK
37 COMPREPLY=( $(compgen -W "sectors" -- $cur) )
38 return 0
39 ;;
40 esac
41 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
42 return 0
43}
44complete -F _blockdev_module blockdev