CARG_PARSER(1)

NAME
carg_parser - test program for Arg_parser

SYNOPSIS
carg_parser [options]

DESCRIPTION
Arg_parser - POSIX/GNU command-line argument parser. (C version)

Arg_parser is an argument parser that follows POSIX and GNU conventions for command-line arguments. There exist C++ and C versions of Arg_parser. The C++ version is implemented as a C++ class, while the C version is implemented as a single struct plus associated functions. Both are simpler, easier to use, and safer than 'getopt_long'.

For maximum stability, Arg_parser is self-contained. It extracts all the information it needs from its arguments to avoid referring to them later. This avoids index-out-of-bounds errors and allows the parser object to be passed as argument to other functions for further analysis.

Arg_parser does not modify its arguments (argc, argv), nor uses any global variables.

The C++ version of Arg_parser can also parse options from configuration files.

The C version of Arg_parser is provided in the files 'carg_parser.h' and 'carg_parser.c'. To learn how to use Arg_parser in your C programs, see the C example in the manual and the example file 'cmain.c' in the source tarball.

OPTIONS

-h, --help
    display this help and exit

-V, --version
    output version information and exit

-a, --append
    example of option with no argument

-b, --block=<arg>
    example of option with required argument

-c, --casual[=<arg>]
    example of option with optional argument

-e, --empty=<arg>
    example of option with maybe empty argument

-o <arg>
    example of short only option

--long-only
    example of long only option

-q, --quiet
    quiet operation

-u, --uncaught
    example of intentional bug

-v, --verbose
    verbose operation

REPORTING BUGS
Report bugs to arg-parser-bug@nongnu.org
Arg_parser home page: http://www.nongnu.org/arg-parser/arg_parser.html

COPYRIGHT
Copyright © 2025 Antonio Diaz Diaz. License 2-clause BSD.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.

SEE ALSO
The full documentation for carg_parser is maintained as a Texinfo manual. If the info and carg_parser programs are properly installed at your site, the command

    info arg_parser

should give you access to the complete manual.