Parsing parameters to main()

2019-05-03 08:57发布

问题:

In C++, is there a well done, complete, open source implementation of a utility to parse the parameters of the main() function?

I wrote my own, and I saw many others around. But I was wandering if there is a better implementation available, which provides all the features expected from the corresponding executable.

回答1:

  • getopt
  • boost program options
  • Poco OptionSet/OptionProcessor


回答2:

Boost provides an open-source implementation with ProgramOptions.



回答3:

Take a look at this framework: CmdLine: a C++ option-parsing framework