1#ifndef KOUTIL_ARGS_COMMAND_BUILDER_H
2#define KOUTIL_ARGS_COMMAND_BUILDER_H
44 :
m_cmd(name, description) { }
53 template <
void_handle<std::optional<std::
string_view>, result_t&> Handle>
55 :
m_cmd(name, description, std::forward<Handle>(handle)) { }
64 return std::move(*
this);
74 return std::move(*
this);
84 return std::move(*
this);
Builder for creating command-line command.
Definition command_builder.h:31
option_t< result_t > option_t
Definition command_builder.h:35
command_t< result_t > command_t
Definition command_builder.h:34
argument_t< result_t > argument_t
Definition command_builder.h:36
command_builder_t(std::string_view name, std::string_view description)
Constructs a builder for a command with name and description.
Definition command_builder.h:43
command_builder_t && add_argument(const argument_t &argument) &&
Adds a positional argument to the command.
Definition command_builder.h:72
command_builder_t && add_command(command_t &&command) &&
Adds a subcommand to the command.
Definition command_builder.h:82
command_builder_t && add_option(const option_t &option) &&
Adds an option to the command.
Definition command_builder.h:62
command_t build() &&
Builds and returns the final command.
Definition command_builder.h:91
command_t m_cmd
Definition command_builder.h:94
Result result_t
Definition command_builder.h:33
command_builder_t(std::string_view name, std::string_view description, Handle &&handle)
Constructs a builder for a command with name, description, and handler.
Definition command_builder.h:54
bool add_option(const option_t &option)
Adds an option to the command.
Definition command_impl.h:41
void add_argument(const argument_t &argument)
Adds a positional argument.
Definition command_impl.h:65
bool add_command(command_t &&command)
Adds a subcommand.
Definition command_impl.h:24