#  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.
xpc_mode_12_C='case "${COMP_WORDS[${COMP_CWORD//-/999}]}" in *=*) echo -e "r\nw\nx\nX\ns\nt\nu\ng\no" ;; [0-9]*) echo -e "0\n1\n2\n3\n4\n5\n6\n7" ;; *) echo -e "u\ng\no\na" ;; esac #'
xpc_mode_9_C='case "${COMP_WORDS[${COMP_CWORD//-/999}]}]}" in *=*) echo -e "r\nw\nx" ;; [0-9]*) echo -e "0\n1\n2\n3\n4\n5\n6\n7" ;; *) echo -e "u\ng\no\na" ;; esac; #'
xpc_digit_W='0 1 2 3 4 5 6 7 8 9'
xpc_version_control_W='none off numbered t existing nil simple never'
xpc_term_C="find /etc/terminfo/ -type f -printf '%f\n'"
xpc_papertype_W='a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 archA 11x17 archB archC archD archE b0 b1 b2 b3 b4 b5 flsa flse halfletter ledger legal letter note'
xpc_url_C=":"
xpc_mf_modes_C="sed -n 's/^mode_def \([[:alnum:]]\+\).*/\1/p' /etc/texmf/modes.mf"
xpc_mail_address_C="
for file in  ~/.mailrc ~/.muttrc
do
	test -f \$file || continue
	sed -n 's/^[[:space:]]*alias.*[^[:alnum:]._-]\([[:alnum:]._-]*@[[:alnum:]._-]*\).*/\1/p' \$file
done"

# utility code for dd(1) style options
# xpc_nodash_subopts  for suboptions (like the dd(1) conv= option)
# xpc_nodash_opts  for single value (options like the dd(1) if= option)
xpc_nodash_subopts='
case "$XPC_PATTERN" in
*,*) echo -e "\eprefix=${XPC_PATTERN%,*}," 
    XPC_PATTERN="${XPC_PATTERN##*,}"
    ;;
*)  echo -e "\eprefix=${XPC_PATTERN%%=*}="
    XPC_PATTERN="${XPC_PATTERN#*=}"
    ;;
esac
echo -e "\eappend=,"
'
xpc_nodash_opts='
echo -e "\eprefix=${XPC_PATTERN%%=*}="
XPC_PATTERN="${XPC_PATTERN#*=}"
'
