2013-03-23 17:41:32 +00:00
|
|
|
_whereis_module()
|
|
|
|
{
|
|
|
|
local cur prev OPTS
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
case $prev in
|
|
|
|
'-B'|'-M'|'-S')
|
2013-09-30 15:49:00 +02:00
|
|
|
local IFS=$'\n'
|
2013-03-23 17:41:32 +00:00
|
|
|
compopt -o filenames
|
|
|
|
COMPREPLY=( $(compgen -o dirnames -- ${cur:-"/"}) )
|
|
|
|
return 0
|
|
|
|
;;
|
2013-04-07 11:12:04 +03:00
|
|
|
'-h'|'-V')
|
|
|
|
return 0
|
|
|
|
;;
|
2013-03-23 17:41:32 +00:00
|
|
|
esac
|
|
|
|
case $cur in
|
|
|
|
-*)
|
2023-01-25 14:13:05 +01:00
|
|
|
OPTS="-b -B -m -M -s -S -f -u -l -g"
|
2013-03-23 17:41:32 +00:00
|
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
2021-08-08 18:04:30 -04:00
|
|
|
COMPREPLY=( $(compgen -c -- $cur) )
|
2013-03-23 17:41:32 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _whereis_module whereis
|