[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
AutoOpts can generate the main procedure in certain circumstances. It will do this to help with integrating with the guile library environment, and for creating a program to convert command line options into environment variables for use in processing shell script options and for testing the command line interface.
guile-main
has been specified and if this is specified
as well, then this code will be inserted into the actual main()
procedure before gh_enter()
is called.
optionProcess()
and will
invoke any code specified by this attribute. If this attribute
does not specify any code, then calls to the AutoOpts library procedure
export_options_to_guile()
and then scm_shell()
will
be inserted into inner_main()
.
int main( int argc, char** argv ) { [+ main-text +] return EXIT_SUCCESS; } |
test-main
is short (3 or fewer characters), the
generated main() will call putBourneShell. That routine will emit
Bourne shell commands that can be eval-ed by a Bourne-derived shell to
incorporate the digested options into the shell's environment,
See section 7.7 AutoOpts for Shell Scripts. You would use it thus:
eval "`./programopts $@`" test -z "${OPTION_CT}" ] && exit 1 test ${OPTION_CT} -gt 0 && shift ${OPTION_CT} |
test-main
contains putShellParse
, the
program will generate portable Bourne shell commands that will parse the
command line options. The expectation is that this result will be
copied into a shell script and used there, See section 7.7 AutoOpts for Shell Scripts.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |