dimanche 15 mars 2015

C++ Boost Program Options - Command-line AND Config option unrecognised


I am trying to have an option be configurable via command-line and config file.



sample.ini
currency=USD

command-line
--currency


But I cannot seem to successfully configure the program options interface to read the currency in through the file.


Paste bin for code source: http://ift.tt/1ESGuMh


The output from above code:



root$ ./a.out add
Parse Error: unrecognised option 'currency'


Not sure what I am doing wrong, I look at a lot of examples and see the same code. All I can think of is that I use allowunrecognised which may interfere?




Aucun commentaire:

Enregistrer un commentaire