52 using OptionProcessor = std::function<bool(
const char *)>;
58 const char *description;
59 OptionProcessor processor;
62 const char *binaryName;
67 std::ostream *outStream = &std::cerr;
69 std::map<cstring, const Option *> options;
70 std::vector<cstring> optionOrder;
71 std::vector<const char *> additionalUsage;
72 std::vector<const char *> remainingOptions;
74 bool collectUnknownOptions =
false;
76 void setOutStream(std::ostream *out) { outStream = out; }
77 void registerUsage(
const char *msg) { additionalUsage.push_back(msg); }
78 void registerOption(
const char *option,
81 OptionProcessor processor,
82 const char *description,
85 explicit Options(std::string_view message)
86 : binaryName(nullptr), message(message), compileCommand(
"") {}
101 virtual std::vector<const char *> *
process(
int argc,
char *
const argv[]);
103 [[nodiscard]]
virtual const char *getIncludePath()
const = 0;
104 cstring getCompileCommand() {
return compileCommand; }
105 cstring getBuildDate() {
return buildDate; }
106 cstring getBinaryName() {
return cstring(binaryName); }
107 virtual void usage();