Eugene Loy
Eugene Loy

Reputation: 12416

Snippet/lib that handles command line arguments parsing/validation

I have to write some command line utility that should be able to take bunch of arguments of different types and with dependences between them.

I am lazy enough to reinvent the wheel and assume that there is some already made snippets/mini libs that can handle this type of task.

It would be great to have api where I could describe validation rules, defaults, etc, then feed the raw argc/argv to it and get map of parsed values.

What I need:

Thanks.

Upvotes: 0

Views: 289

Answers (1)

Sebtm
Sebtm

Reputation: 7164

You can use the library of Boost program_options:

The documentation with examples is here:

http://www.boost.org/doc/libs/1_42_0/doc/html/program_options/tutorial.html

Upvotes: 3

Related Questions