1

I'm looking for some library with support for strict set of options (so non-existent options couldn't be set in config file) and possibility to also parse command line to override options from config file. Any ideas?

4
  • What have you found yourself, e.g. with Google or similar? Commented Apr 13, 2012 at 14:19
  • I've found tonns of libraries, but none of them supports command line argument overriding. In other case I wouldn't ask. Commented Apr 13, 2012 at 14:21
  • What is problem to use two libraries? Commented Apr 13, 2012 at 17:04
  • combining results also more dependencies Commented Apr 15, 2012 at 19:52

2 Answers 2

1

For command line, there is getopt or plentiful of code, some with more, some with less strange APIs, some in the form of open-codedness like getopt, others in table form with or without callback ability. As for config file, there is (lib)augeas if you need support for almost arbitrary formats.

Sign up to request clarification or add additional context in comments.

1 Comment

I need library able to parse both: config files and command line. Not just config files. There are plenty of such libraries.
0

Assuming you can use LGPL stuff in your project, there's http://www.hyperrealm.com/libconfig/, which appears, according to the docs, to have support in the API for setting values after a file has been parsed.

4 Comments

I know that and libconfuse has it too, but I don't want to do that manually. IMHO thats a really common task so there should be some ready solutions.
You don't want to have to take argv and place it into a library's data manually?
No, I don't. Also libconfig doesn't have strict set of options.
What infinite number? What drugs? Are you nuts? Thats what I need, but its for C++: boost.org/doc/libs/1_49_0/doc/html/program_options.html It has support for both: config file and command line options.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.