
. ../include/common

cmd=man

optcomplete -V l $cmd local-file l
optcomplete  $cmd D default  7 ascii  a all  c catman  f whatis  k apropos  u update  t troff  Z ditroff  w where location
optcomplete -C 'sed  -n "/^[a-z]/{;s/[ 	].*//;/^${XPC_PATTERN%%[^[:alnum:]]*}/p;}" /etc/locale.alias #'  $cmd locale L
optcomplete -c  $cmd pager P
optcomplete -m arg_required  $cmd prompt
optcomplete -V s -W '1 2 3 4 5 6 7 8 9'  $cmd sections S
optcomplete -V e -C "whatis -w \* 2>&1 | sed -n 's/^[^ ]* ([1-9]\\([^)]\\+\\)) .*/\\1/p'|uniq|sort -u #"  $cmd extension e
optcomplete -O0 -W 'e g p t v r'  $cmd p preprocessor 
optcomplete -C 'command ls -1 /usr/share/groff/font/ | cut -c4-  #'  $cmd device T
optcomplete -m rlhint,array -V no -C '
if test -n "$XPC_l"; then
	compgen -f -- "$XPC_PATTERN"
	echo -e "\efilename"
	return
fi
case "$XPC_s" in
1|2|3|4|5|6|7|8|9) : ;;
*) unset XPC_s ;;
esac
case "$XPC_e" in
*[^[:alnum:]]*) unset XPC_e ;;
esac
if test -z "$XPC_s" -a -z "${XPC_no[0]#[123456789]}"; then
	XPC_s=${XPC_no[0]}
fi
if test -n "$XPC_s$XPC_e" ; then 
	whatis -w "$XPC_PATTERN"\* 2>&1 | grep -e "^[[:alnum:]][[:print:]]* (${XPC_s:-[0-9]}${XPC_e:+$XPC_e)}" | cut -d\  -f1; 
else 
	whatis -w "$XPC_PATTERN"\* 2>&1 | grep -e "^[[:alnum:]][[:print:]]* (${XPC_s:-[0-9]}${XPC_e:+$XPC_e)}" | cut -d\  -f1; 
fi #'  $cmd NONOPT
optcomplete -m long,getoptparse  $cmd

for cmd in whatis apropos
do
     optcomplete  $cmd e exact
     optcomplete  $cmd r regex
     optcomplete  $cmd w wildcard
     optcomplete -C 'whatis -w "$XPC_PATTERN"\* 2>&1 | grep -e "^[[:alnum:]][[:print:]]* ([0-9]" | cut -d\  -f1  #'  $cmd NONOPT

     optcomplete -m long  $cmd 
done



for cmd in man whatis apropos
do
    optcomplete -m arg_required  $cmd system m
    optcomplete -O: -d  $cmd manpath M
    optcomplete  $cmd V version  h help  d debug  
    
    complete -F xpcompfunc $cmd
done

unset cmd ${!xpc_*}

