CPGen
C++ project generator
Loading...
Searching...
No Matches
CLI.hpp
Go to the documentation of this file.
1#pragma once
2
22#include "CPGen/Core/Config.hpp"
23#include <variant>
24
34using Config = std::variant<ProjectConfig, bool>;
35
58class CLI {
59public:
76 Config parse(int argc, char **argv);
77
78private:
87 void parseName(int argc, char **argv, int &i);
88
98 void parsePath(int argc, char **argv, int &i);
99
109 void parseStandard(int argc, char **argv, int &i);
110
120 void parseModules(int argc, char **argv, int &i);
121
133 void parseTargets(int argc, char **argv, int &i);
134
142 void parseClangFormatPreset(int argc, char **argv, int &i);
143
152 void parseProjectFlag(int argc, char **argv, int &i);
153
162 void parseToolingFlag(int argc, char **argv, int &i);
163
167 static void showHelp();
168
169 ProjectConfig m_config;
171};
std::variant< ProjectConfig, bool > Config
Result type of CLI::parse.
Definition CLI.hpp:34
Project configuration types produced by the CLI and consumed by the resolvers.
Stateful command-line parser that converts argv into a Config.
Definition CLI.hpp:58
Config parse(int argc, char **argv)
Parse command-line arguments into a typed configuration.
Definition CLI.cpp:58
Fully parsed project configuration produced by CLI::parse.
Definition Config.hpp:59