#  Copyright (C) 2003 Ingo K"ohne
#  
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#  
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#  
#  You should have received a copy of the GNU General Public License along
#  with this program; if not, write to the Free Software Foundation, Inc.,
#  59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.

. ../include/common

info_nodes='sed -n "/^* ${XPC_PATTERN%%[^[:alnum:]+._-]*}[^:]*::\?[ 	].*/{;s/^..\([^:]*\).*/\1/;s/ /\\\\ /g;p;}"' 

cmd=info

optcomplete -m arg_required  $cmd apropos
optcomplete -d  $cmd directory
optcomplete -f	$cmd dribble
optcomplete -V f -f  $cmd file f
optcomplete  $cmd help
optcomplete -m arg_required  $cmd index-search
optcomplete -f	$cmd output
optcomplete -f	$cmd restore
optcomplete  $cmd usage show-options
optcomplete  $cmd subnodes
optcomplete  $cmd vi-keys
optcomplete  $cmd version
optcomplete -C '
test -n "$XPC_f" && info -f "$XPC_f" --output=- |'"$info_nodes"' #' $cmd node
optcomplete -m array -V node -C '
eval info ${XPC_f+-f "$XPC_f"} --output=- "${XPC_node[@]}" 2>&1 | 
	'"$info_nodes"' #'  $cmd NONOPT

optcomplete -m long,getoptparse  $cmd

complete -F xpcompfunc  $cmd

unset cmd ${!xpc_*} info_nodes
