CLIOption< N > Class Template Reference

A static object whose constructor registers a parameter with the CLI class. More...

Public Member Functions

 CLIOption (const N defaultValue, const std::string &identifier, const std::string &description, const std::string &alias, const std::string &cppName, const bool required=false, const bool input=true, const bool noTranspose=false, const std::string &="")
 Construct an Option object. More...

 

Detailed Description


template
<
typename
N
>

class mlpack::bindings::cli::CLIOption< N >

A static object whose constructor registers a parameter with the CLI class.

This should not be used outside of CLI itself, and you should use the PARAM_FLAG(), PARAM_DOUBLE(), PARAM_INT(), PARAM_STRING(), or other similar macros to declare these objects instead of declaring them directly.

See also
core/util/cli.hpp, mlpack::CLI

Definition at line 48 of file cli_option.hpp.

Constructor & Destructor Documentation

◆ CLIOption()

CLIOption ( const N  defaultValue,
const std::string &  identifier,
const std::string &  description,
const std::string &  alias,
const std::string &  cppName,
const bool  required = false,
const bool  input = true,
const bool  noTranspose = false,
const std::string &  = "" 
)
inline

Construct an Option object.

When constructed, it will register itself with CLI.

Parameters
defaultValueDefault value this parameter will be initialized to (for flags, this should be false, for instance).
identifierThe name of the option (no dashes in front; for –help, we would pass "help").
descriptionA short string describing the option.
aliasShort name of the parameter. "" for no alias.
cppNameName of the C++ type of this parameter (i.e. "int").
requiredWhether or not the option is required at runtime.
inputWhether or not the option is an input option.
noTransposeIf the parameter is a matrix and this is true, then the matrix will not be transposed on loading.
*(testName) Is not used and added for compatibility reasons.

Definition at line 68 of file cli_option.hpp.

References CLI::Add(), ParamData::alias, BASH_CLEAR, BASH_RED, ParamData::cppType, ParamData::desc, CLI::functionMap, CLI::GetSingleton(), ParamData::input, ParamData::loaded, mlpack::bindings::cli::MapParameterName(), ParamData::name, ParamData::noTranspose, CLI::Parameters(), ParamData::persistent, ParamData::required, ParamData::tname, TYPENAME, ParamData::value, and ParamData::wasPassed.


The documentation for this class was generated from the following file:
  • /home/ryan/src/mlpack.org/_src/mlpack-3.3.2/src/mlpack/bindings/cli/cli_option.hpp