56 lines
1.1 KiB
Plaintext
Raw Normal View History

2009-05-18 23:02:38 +02:00
# bash completion for rpcdebug
have rpcdebug || return
2009-05-18 23:02:38 +02:00
_rpcdebug_flags()
{
2009-10-04 19:42:50 +02:00
local i module
for (( i=0; i < ${#words[@]}; i++ )); do
if [[ ${words[i]} == -m ]]; then
module=${words[i+1]}
2009-10-04 19:42:50 +02:00
fi
done
if [ -n "$module" ]; then
COMPREPLY=( $( compgen -W "$( rpcdebug -vh 2>&1 | \
sed -ne 's/^'$module'[[:space:]]\{1,\}//p' )" -- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2009-05-18 23:02:38 +02:00
}
_rpcdebug()
{
local cur prev words cword
_init_completion || return
2009-10-04 19:42:50 +02:00
case $prev in
-s)
_rpcdebug_flags
return 0
;;
-c)
_rpcdebug_flags
return 0
;;
-m)
COMPREPLY=( $( compgen -W 'rpc nfs nfsd nlm' -- "$cur" ) )
return 0
;;
esac
if [[ "$cur" == -* ]]; then
2011-05-15 15:18:55 +03:00
COMPREPLY=( $( compgen -W '$( _parse_usage "$1" -h ) -s -c' \
-- "$cur" ) )
2009-10-04 19:42:50 +02:00
fi
2011-04-04 22:14:39 +03:00
} &&
2009-05-18 23:02:38 +02:00
complete -F _rpcdebug rpcdebug
# Local variables:
# mode: shell-script
2009-10-04 19:42:50 +02:00
# sh-basic-offset: 4
# sh-indent-comment: t
2009-10-04 19:42:50 +02:00
# indent-tabs-mode: nil
# End:
2009-10-04 19:42:50 +02:00
# ex: ts=4 sw=4 et filetype=sh