28 void addOption(OptionType type, std::string
const &name,
char shortName,
29 std::string
const &help = std::string(),
bool hidden =
false);
30 void addPositional(std::string
const &name,
31 std::string
const &help = std::string(),
35 int parse(
int argc,
char **argv);
38 bool getBool(std::string
const &name)
const;
39 std::string
const &getString(std::string
const &name)
const;
40 std::vector<std::string>
const &getVector(std::string
const &name)
const;
41 std::string
const &getPositional(std::string
const &name)
const;
44 void usageDie(
char const *format =
nullptr, ...);
47 struct OptionStorage {
52 std::string stringValue;
53 std::vector<std::string> vectorValue;
59 struct PositionalStorage {
65 typedef std::map<std::string, OptionStorage> OptionCollection;
66 typedef std::map<std::string, PositionalStorage> PositionalCollection;
69 OptionCollection _options;
70 PositionalCollection _positionals;
74 OptionCollection::iterator findShortOpt(
char shortOption);
75 OptionStorage
const &get(std::string
const &name, OptionType type)
const;