]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/raw
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / raw
CommitLineData
bf60993c
SK
1_raw_module()
2{
d4f9b8d7 3 local cur prev
bf60993c
SK
4 COMPREPLY=()
5 cur="${COMP_WORDS[COMP_CWORD]}"
d4f9b8d7
VS
6 prev="${COMP_WORDS[COMP_CWORD-1]}"
7 case $prev in
8 '-h'|'--help'|'-V'|'--version')
9 return 0
10 ;;
11 esac
bf60993c
SK
12 case $cur in
13 -*)
14 local OPTS
0d5b9b8a 15 OPTS="--query --all --help --version"
bf60993c
SK
16 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
17 return 0
18 ;;
19 esac
20 COMPREPLY=( $(compgen -W "$(for I in /dev/raw/*; do if [ -e $I ]; then echo $I; fi; done)" -- $cur) )
21 return 0
22}
23complete -F _raw_module raw