src/mlpack/bindings/cli/print_doc_functions_impl.hpp
inline std::string ParamString(const std::string& paramName)
{
  // Return the correct parameter name.
  if (CLI::Parameters().count(paramName) > 0)
  {
    util::ParamData& d = CLI::Parameters()[paramName];

    std::string output;
    CLI::GetSingleton().functionMap[d.tname]["GetPrintableParamName"](d, NULL,
        (void*) &output);
    // Is there an alias?
    std::string alias = "";
    if (d.alias != '\0')
      alias = " (-" + std::string(1, d.alias) + ")";

    return "'" + output + alias + "'";
  }
  else
  {
    throw std::runtime_error("Parameter '" + paramName + "' not known!  Check "
        "PROGRAM_INFO() definition.");
  }
}
/**
 * Print what a user would type to invoke the given option name.  Note that the
 * name *must* exist in the CLI module.  (Note that because of the way
 * ProgramInfo is structured, this doesn't mean that all of the PARAM_*()
 * declarataions need to come before the PROGRAM_INFO() declaration.)
 */
Print what a user would type to invoke the given option name.  Note that the
name *must* exist in the CLI module.  (Note that because of the way
ProgramInfo is structured, this doesn't mean that all of the PARAM_*()
declarataions need to come before the PROGRAM_INFO() declaration.)
Print what a user would type to invoke the given option name . Note that the name * must * exist in the CLI module . ( Note that because of the way ProgramInfo is structured this doesn ' t mean that all of the PARAM_ * () declarataions need to come before the PROGRAM_INFO () declaration . )
inline std::string ParamString(const std::string& paramName)
{
  if (CLI::Parameters().count(paramName) > 0)
  {
    util::ParamData& d = CLI::Parameters()[paramName];
    std::string output;
    CLI::GetSingleton().functionMap[d.tname]["GetPrintableParamName"](d, NULL,
        (void*) &output);
    std::string alias = "";
    if (d.alias != '\0')
      alias = " (-" + std::string(1, d.alias) + ")";
    return "'" + output + alias + "'";
  }
  else
  {
    throw std::runtime_error("Parameter '" + paramName + "' not known!  Check "
        "PROGRAM_INFO() definition.");
  }
}
inline std :: string ParamString ( const std :: string & paramName ) { if ( CLI :: Parameters ( ) . count ( paramName ) > 0 ) { util :: ParamData & d = CLI :: Parameters ( ) [ paramName ] ; std :: string output ; CLI :: GetSingleton ( ) . functionMap [ d . tname ] [ " " ] ( d , NULL , ( void * ) & output ) ; std :: string alias = " " ; if ( d . alias != ' \0 ' ) alias = " " + std :: string ( 1 , d . alias ) + " " ; return " " + output + alias + " " ; } else { throw std :: runtime_error ( " " + paramName + " " " " ) ; } }
Print what a user would type to invoke the given option name.
Print what a user would type to invoke the given option name .
// Return the correct parameter name. // Is there an alias?