23namespace cli::commands
 
   27enum class ArgumentKind
 
   45#pragma region Accessors 
   50    [[nodiscard]] 
constexpr std::string_view 
getName() const noexcept { 
return name; }
 
   58        return optionsComment;
 
 
   63    [[nodiscard]] 
constexpr bool isRequired() const noexcept { 
return required; }
 
   67    [[nodiscard]] 
constexpr bool isRepeatable() const noexcept { 
return repeatable; }
 
   71    [[nodiscard]] 
constexpr ArgumentKind 
getArgType()
 const { 
return argType; }
 
   89#pragma endregion Accessors 
   92    ArgumentBase(std::string_view name, std::string_view optionsComment, ArgumentKind argType,
 
   93                 bool repeatable, 
bool required)
 
   94        : name(name), optionsComment(optionsComment), argType(argType), repeatable(repeatable),
 
   99    const std::string name;
 
  100    std::string optionsComment;
 
  101    const ArgumentKind argType;
 
  102    bool repeatable{
false};
 
 
  114    [[nodiscard]] std::type_index 
getType()
 const { 
return type; }
 
  119    [[nodiscard]] 
virtual std::any 
parseToValue(
const std::string &input) 
const = 0;
 
  124    const std::type_index type;
 
 
  133    [[nodiscard]] 
constexpr std::string_view 
getShortName() const noexcept { 
return shortName; }
 
  138    std::string shortName;
 
 
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
virtual std::string getOptionsDocString(const docwriting::DocWriter &writer) const =0
Get the options documentation string for the argument.
virtual std::string getArgDocString(const docwriting::DocWriter &writer) const =0
Get the argument documentation string for the argument.
constexpr ArgumentKind getArgType() const
Get the type of the argument.
Definition argument.h:71
constexpr bool isRepeatable() const noexcept
Check if the argument is repeatable.
Definition argument.h:67
constexpr std::string_view getOptionComment() const noexcept
Get the option comment for the argument.
Definition argument.h:56
constexpr std::string_view getName() const noexcept
Get the name of the argument.
Definition argument.h:50
Base class for flag-like command-line arguments.
Definition argument.h:129
constexpr std::string_view getShortName() const noexcept
Get the short name of the argument.
Definition argument.h:133
Base class for typed command-line arguments.
Definition argument.h:108
virtual std::any parseToValue(const std::string &input) const =0
Parse the input string to the argument's value type.
std::type_index getType() const
Get the type of the argument.
Definition argument.h:114
Documentation writer for CLI commands. Consists of formatters for commands and arguments.
Definition docwriting.h:34