MCPcopy Create free account
hub / github.com/apache/qpid-proton / parse

Method parse

cpp/examples/options.hpp:64–75  ·  view source on GitHub ↗

Parse the command line, return the index of the first non-option argument. *@throws bad_option if there is a parsing error or unknown option. */

Source from the content-addressed store, hash-verified

62 *@throws bad_option if there is a parsing error or unknown option.
63 */
64 int parse() {
65 int arg = 1;
66 for (; arg < argc_ && argv_[arg][0] == '-'; ++arg) {
67 opts::iterator i = opts_.begin();
68 while (i != opts_.end() && !(*i)->parse(argc_, argv_, arg))
69 ++i;
70 if (i == opts_.end())
71 throw bad_option(std::string("unknown option ") + argv_[arg]);
72 }
73 if (help_) throw bad_option("");
74 return arg;
75 }
76
77 /** Print a usage message */
78 friend std::ostream& operator<<(std::ostream& os, const options& op) {

Callers 15

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 3

bad_optionClass · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected