24#include "parsing/parser_utils.h"
26namespace cli::commands
38 explicit FlagArgument(std::string_view name, std::string_view shortName =
"",
39 std::string_view optionsComment =
"",
bool isRequired =
false)
49#pragma region ChainingMethods
57 optionsComment = comment;
77 this->shortName = name;
80#pragma endregion ChainingMethods
Base class for command-line arguments.
Definition argument.h:41
constexpr bool isRequired() const noexcept
Check if the argument is required.
Definition argument.h:63
Represents a flag argument in the CLI.
Definition flag_argument.h:31
std::string getArgDocString(const docwriting::DocWriter &writer) const override
Get the argument documentation string for the argument.
Definition flag_argument.cpp:27
FlagArgument & withShortName(std::string_view name)
Set the short name for the argument.
Definition flag_argument.h:75
FlagArgument & withOptionsComment(std::string_view comment)
Set the options comment for the argument.
Definition flag_argument.h:55
std::string getOptionsDocString(const docwriting::DocWriter &writer) const override
Get the options documentation string for the argument.
Definition flag_argument.cpp:22
FlagArgument & withRequired(bool req)
Set whether the argument is required.
Definition flag_argument.h:64
FlagArgument(std::string_view name, std::string_view shortName="", std::string_view optionsComment="", bool isRequired=false)
Construct a new Flag Argument object.
Definition flag_argument.h:38
Base class for flag-like command-line arguments.
Definition argument.h:129
Documentation writer for CLI commands. Consists of formatters for commands and arguments.
Definition docwriting.h:34