AutoGen - The Automated Program Generator: 7.12.1 Parsing with an Executable

[ < ] | [ > ] |  | [ << ] | [ Up ] | [ >> ] |  |  |  |  | [Top] | [Contents] | [Index] | [ ? ]

### 7.12.1 Parsing with an Executable

The following commands are approximately all that is needed to build a shell script command line option parser from an option definition file:

    autogen -L <opt-template-dir> test-errors.def
    cc -o test-errors -L <opt-lib-dir> -I <opt-include-dir> \
            -DTEST_PROGRAM_OPTS test-errors.c -lopts

The resulting program can then be used within your shell script as follows:

    eval `./test-errors "$@"`
    if [ -z "${OPTION_CT}" ] ; then exit 1 ; fi
    test ${OPTION_CT} -gt 0 && shift ${OPTION_CT}

This document was generated by Bruce Korb on June 25, 2010 using texi2html 1.82.