diff options
author | Karel Zak <kzak@redhat.com> | 2013-04-05 14:58:07 +0200 |
---|---|---|
committer | Karel Zak <kzak@redhat.com> | 2013-04-05 14:58:07 +0200 |
commit | 20da58084a68b118b15fa01228192463b61fa28f (patch) | |
tree | 07beea113d5a68749264ad59e4d17fbc4bf9fe1d /bash-completion/blockdev | |
parent | aead7c7e690ab019e0706f228a226b8c17eeab38 (diff) | |
download | util-linux-20da58084a68b118b15fa01228192463b61fa28f.tar.gz |
bash-completion: rename shell-completion -> bash-completion
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'bash-completion/blockdev')
-rw-r--r-- | bash-completion/blockdev | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/bash-completion/blockdev b/bash-completion/blockdev new file mode 100644 index 00000000..ce986cb4 --- /dev/null +++ b/bash-completion/blockdev @@ -0,0 +1,44 @@ +_blockdev_module() +{ + local cur prev OPTS + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + while read dev; do DEVS+="$dev " ; done < <(lsblk -pnro name) + OPTS="-h -V -q + --report + --getsz + --setro + --setrw + --getro + --getdiscardzeroes + --getss + --getpbsz + --getiomin + --getioopt + --getalignoff + --getmaxsect + --getbsz + --setbsz + --getsize64 + --setra + --getra + --setfra + --getfra + --flushbufs + --rereadpt + $DEVS" + case $prev in + '--setbsz') + COMPREPLY=( $(compgen -W "bytes" -- $cur) ) + return 0 + ;; + '--setbsz'|'--setfra') + COMPREPLY=( $(compgen -W "sectors" -- $cur) ) + return 0 + ;; + esac + COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) + return 0 +} +complete -F _blockdev_module blockdev |