]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/whereis
su: use lib/pty-session.c code for --pty
[thirdparty/util-linux.git] / bash-completion / whereis
1 _whereis_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 '-B'|'-M'|'-S')
9 local IFS=$'\n'
10 compopt -o filenames
11 COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
12 return 0
13 ;;
14 '-h'|'-V')
15 return 0
16 ;;
17 esac
18 case $cur in
19 -*)
20 OPTS="-b -B -m -M -s -S -f -u -l"
21 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
22 return 0
23 ;;
24 esac
25 COMPREPLY=( $(compgen -W "file" -- $cur) )
26 return 0
27 }
28 complete -F _whereis_module whereis