]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/look
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / look
1 _look_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'|'--terminate')
9 COMPREPLY=( $(compgen -W "char" -- $cur) )
10 return 0
11 ;;
12 '-h'|'--help'|'-V'|'--version')
13 return 0
14 ;;
15 esac
16 case $cur in
17 -*)
18 OPTS="--alternative --alphanum --ignore-case --terminate --version --help"
19 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
20 return 0
21 ;;
22 esac
23 case $COMP_CWORD in
24 1)
25 COMPREPLY=( $(compgen -W "$(look "$cur")" -- $cur) )
26 ;;
27 2)
28 local IFS=$'\n'
29 compopt -o filenames
30 COMPREPLY=( $(compgen -f -- $cur) )
31 ;;
32 esac
33 return 0
34 }
35 complete -F _look_module look