ezOptionParser
-
Overview
-
Download
-
Installation
-
Examples
-
News
It's another command-line parser class for C++ that has features not available in alternative solutions (getopt, boost, argtable, argstream) and doesn't require a high learning curve.
Features
-
Pretty printing of parsed inputs for debugging.
-
Auto usage message creation in three layouts (aligned, interleaved or staggered).
-
Tiny download and no linking due to single header file implementation.
-
Dependent only on STL.
-
Arbitrary short and long option names (dash or plus prefixes not required).
-
Arbitrary argument list delimiters.
-
Multiple flag instances allowed.
-
Validation of required options and number of expected arguments per flag.
-
Multiple file import with comments.
-
Exports to file, either set options or all options including defaults when available.
-
LGPL license.
-
Minimal learning curve due to many examples.
-
Automated regression and memory tests with valgrind.
Source Code, Examples and Tests: ezopt-0.0.0.tgz
Source Code for immediate use:
ezOptionParser.hpp
Source Code for online viewing:
ezOptionParser.html
-
tar -zxvf ezopt-*tgz
-
cd examples; make
-
make clean;
-
complete.cpp
A complete example that could be used as a starting point for your own C++ program.
-
fileio.cpp
Shows how to import and export options with files (that can contain comments!).
-
full.cpp
A full test of all the features. Meant for testing, but can be a source of ideas for what's possible.
-
long.cpp
Demo of using long flag names.
-
multi.cpp
Shows how to handle multiple instances of a flag.
-
pretty.cpp
Demo of pretty printing everything parsed, which can help in debugging.
-
short.cpp
Short demo of a short flag name.
-
usage.cpp
Demo of automatic usage message creation in three builtin layouts.
Here are the how the three layouts appear:
aligned
interleaved
staggered
Version 0.0.0 (5/11/2011)
1. Published on SourceForge.
Copyright (C) 2011 Remik Ziemlinski