25 [[nodiscard]]
auto make_usage(
const std::string& help)
const -> std::string;
27 std::string m_program_name;
29 std::vector<std::string_view> m_args;
30 std::vector<std::shared_ptr<Option>> m_options;
31 std::vector<Position> m_positions;
34 Parser(
int argc,
const char*
const argv[]);
35 void add_option(
const std::string& flags,
36 const std::string& description,
38 const std::string& output);
39 void add_option(
const std::string& flags,
const std::string& description,
bool& found);
42 void add_option(
const std::string& flags,
const std::string& description, T& value);
44 void add_position(
const std::string& name,
const std::string& description);
47 [[nodiscard]]
auto get_position(
size_t index)
const -> std::string_view;
48 [[nodiscard]]
auto args()
const -> std::vector<std::string_view>;
52 void Parser::add_option(
const std::string& flags,
const std::string& description, T& value)
54 m_options.push_back(std::make_unique<ValueOption>(
55 flags, description, [&value](std::string_view s) { std::istringstream(std::string(s)) >> value; }));
Action
Special tags for options.
Definition: Parser.hpp:17
@ USAGE
Print usage text.
Definition: Parser.hpp:19
@ PRINT
Print message to console then exit.
Definition: Parser.hpp:18
Argument parser.
Definition: Parser.hpp:24