]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/fdformat
bash-completion: Don't offer any more completions after help or version.
[thirdparty/util-linux.git] / bash-completion / fdformat
1 _fdformat_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 '-h'|'--help'|'-V'|'--version')
9 return 0
10 ;;
11 esac
12 DEVS=$(for I in echo /dev/fd*; do if [ -e $I ]; then echo $I; fi; done)
13 OPTS="-n --no-verify -h --help -V --version $DEVS"
14 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
15 return 0
16 }
17 complete -F _fdformat_module fdformat