Inshaping: include/anyarg.h File Reference

Inshaping

Inshaping  0.1
anyarg.h File Reference

A simple option parser for C++. More...

#include <string> #include <vector>
#include <cstdlib>
#include <cstring>

Go to the source code of this file.

Classes

struct  Option
 Data structure of a program option. More...
 
class  Anyarg
 Use this class to define program options and parse command line arguments. More...
 

Detailed Description

A simple option parser for C++.

Author
Li Qibin (liqb0.nosp@m.36@g.nosp@m.mail..nosp@m.com)
Version
0.12
Bug:
no bug found yet
Date
2014/01/28

Anyarg supports both single letter-options (like: -i) and long options (like: –help).

The mixup of short and long options in command line is allowed (like: -v –help).

Options can be given as:

--help
--long=value
--long value
-h
-ab
-c value

where –help, -h, -a, -b are boolean flags, option –long and -c take an argument.

Although options can mix up with non-option arguments, it is a good practice to place options before non-option arguments.

All non-option arugments are collected to a new array in the same order as they are in command line.

Argument – stops the parsing of command line arguments. All the following arguments are treated as non-option arguments.

A single hypen - is parsed as an ordinary non-option arguments. It is usally used to specify input from standard input or output to the standant output.

Assign multiple values to an option is not allowed.

Generated by   doxygen 1.8.14