#! /bin/sh # ## Time-stamp: "2007-07-04 10:11:23 bkorb" ## ident $Id: stdopts.def,v 4.5 2007/07/04 21:36:40 bkorb Exp $ ## ## This file is part of AutoOpts, a companion to AutoGen. ## AutoOpts is free software. ## AutoOpts is copyright (c) 1992-2007 by Bruce Korb - all rights reserved ## ## AutoOpts is available under any one of two licenses. The license ## in use must be one of these two and the choice is under the control ## of the user of the license. ## ## The GNU Lesser General Public License, version 3 or later ## See the files "COPYING.lgplv3" and "COPYING.gplv3" ## ## The Modified Berkeley Software Distribution License ## See the file "COPYING.mbsd" ## ## These files have the following md5sums: ## ## 239588c55c22c60ffe159946a760a33e pkg/libopts/COPYING.gplv3 ## fa82ca978890795162346e661b47161a pkg/libopts/COPYING.lgplv3 ## 66a5cedaf62c4b2637025f049f9b826f pkg/libopts/COPYING.mbsd # This is the standard set of options for testing option processing # It is expected to be dot exec 5> $testname.def cat >&5 <<- _EOF_ AutoGen definitions options; config-header = 'config.h'; prog-name = "test_${testname}"; prog-title = "Test AutoOpts for ${testname}"; _EOF_ echo test_main $test_main echo argument $argument echo long_opts $long_opts test -n "${test_main}" && echo "test-main = '${test_main}';" >&5 test -n "${argument}" && echo "argument = '${argument}';" >&5 test -n "${long_opts}" && echo "long-opts;" >&5 for flag do case "$flag" in ?*:?* ) arg=`echo $flag | sed 's/.*://'` flag=`echo $flag | sed 's/:.*//'` arg=" arg-type = string; arg_default = '$arg';" ;; ?*=[0-9]* ) arg=`echo $flag | sed 's/.*=//'` flag=`echo $flag | sed 's/=.*//'` arg=" arg-type = number; arg_default = '$arg';" ;; ?*: ) flag=`echo $flag | sed 's/://'` arg=" arg-type = string;" ;; ?*= ) flag=`echo $flag | sed 's/=//'` arg=" arg-type = number;" ;; * ) unset arg ;; esac cat <<-_EOF_ flag = { name = "$flag"; descrip = "The $flag option descrip"; _EOF_ ${use_flags} && { flag=`echo $flag | sed 's/\(.\).*/\1/'` echo " value = '${flag}';" } test -n "${arg}" && echo "${arg}" echo "};" echo done >&5 exec 5>&- ## Local Variables: ## Mode: shell-script ## indent-tabs-mode: nil ## sh-indentation: 2 ## End: # end of stdopts.def