42 lines
1.8 KiB
Text
42 lines
1.8 KiB
Text
Description
|
|
|
|
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 'arg_parser.h' and
|
|
'arg_parser.cc'. To learn how to use Arg_parser in your C++ programs, see
|
|
the C++ example in the manual and the example file 'main.cc' in the source
|
|
tarball.
|
|
|
|
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.
|
|
|
|
Arg_parser was developed as the argument parser for GNU moe, because moe's
|
|
argument parsing is rather complex. Then I used it in my other projects,
|
|
including GNU ddrescue, GNU ed, lzip, GNU ocrad, tarlz, and zutils, with
|
|
excellent results.
|
|
|
|
|
|
Copyright (C) 2006-2026 Antonio Diaz Diaz.
|
|
|
|
This file is free documentation: you have unlimited permission to copy,
|
|
distribute, and modify it.
|
|
|
|
The file Makefile.in is a data file used by configure to produce the Makefile.
|
|
It has the same copyright owner and permissions that configure itself.
|