]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/ul
su: use lib/pty-session.c code for --pty
[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="--terminal --indicated --version --help"
24 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
25 return 0
26 ;;
27 esac
28 local IFS=$'\n'
29 compopt -o filenames
30 COMPREPLY=( $(compgen -f -- $cur) )
31 return 0
32 }
33 complete -F _ul_module ul