]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/look
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / look
CommitLineData
76dceb10
SK
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 ;;
d4f9b8d7
VS
12 '-h'|'--help'|'-V'|'--version')
13 return 0
14 ;;
76dceb10
SK
15 esac
16 case $cur in
17 -*)
0d5b9b8a 18 OPTS="--alternative --alphanum --ignore-case --terminate --version --help"
76dceb10
SK
19 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
20 return 0
21 ;;
22 esac
09ad914e
SK
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
76dceb10
SK
33 return 0
34}
35complete -F _look_module look