]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/ul
bash-completion: Don't offer any more completions after help or version.
[thirdparty/util-linux.git] / bash-completion / ul
1 _ul_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 '-t'|'--terminal')
9 local TERM_LIST I
10 TERM_LIST=''
11 for I in /usr/share/terminfo/?/*; do
12 TERM_LIST+="${I##*/} "
13 done
14 COMPREPLY=( $(compgen -W "$TERM_LIST" -- $cur) )
15 return 0
16 ;;
17 '-h'|'--help'|'-V'|'--version')
18 return 0
19 ;;
20 esac
21 case $cur in
22 -*)
23 OPTS="-t --terminal -i --indicated -V --version -h --help"
24 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
25 return 0
26 ;;
27 esac
28 compopt -o filenames
29 COMPREPLY=( $(compgen -f -- $cur) )
30 return 0
31 }
32 complete -F _ul_module ul