[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The following is deprecated. Users are encouraged to use the main description (see section 7.6 Generating main procedures) for specifying the type and content of a generated main procedure. [[note to self: move some of this text to the new section.]]
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.
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()
.
Instead of this, use 7.6 Generating main procedures procedures, specifying
a main-type
of guile
(see section 7.6.1 guile: main and inner_main procedures).
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.
Instead of this, use 7.6 Generating main procedures procedures, specifying
a main-type
of guile
(see section 7.6.1 guile: main and inner_main procedures) and add the
before-guile-boot
attribute.
int main( int argc, char** argv ) { [+ main-text +] return EXIT_SUCCESS; } |
Instead of this, use 7.6 Generating main procedures procedures, specifying
a main-type
of main
(see section 7.6.4 main: user supplied main procedure) and add the
code
attribute.
Instead of this, use 7.6 Generating main procedures procedures, specifying
a main-type
of main
(see section 7.6.4 main: user supplied main procedure) and add the
test-main
attribute.
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.9 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.9 AutoOpts for Shell Scripts.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |