Scarab  v3.3.0
Project 8 C++ Utility Library
Namespaces | Classes | Typedefs | Enumerations | Functions
CLI Namespace Reference

Namespaces

 detail
 
 enums
 
 FailureMessage
 

Classes

class  App
 Creates a command line program, with very few defaults. More...
 
class  ArgumentMismatch
 Thrown when the wrong number of arguments has been received. More...
 
class  AsNumberWithUnit
 
class  AsSizeValue
 
class  BadNameString
 Thrown on construction of a bad name. More...
 
class  Bound
 Produce a bounded range (factory). Min and max are inclusive. More...
 
class  CallForAllHelp
 Usually something like –help-all on command line. More...
 
class  CallForHelp
 -h or –help on command line More...
 
class  CheckedTransformer
 translate named items to other or a value set More...
 
class  Config
 This class provides a converter for configuration files. More...
 
class  ConfigError
 Thrown when extra values are found in an INI file. More...
 
class  ConfigINI
 This converter works with INI files. More...
 
struct  ConfigItem
 Holds values to load into Options. More...
 
class  ConstructionError
 Construction errors (not in parsing) More...
 
class  ConversionError
 Thrown when conversion call back fails, such as when an int fails to coerce to a string. More...
 
class  CustomValidator
 Class wrapping some of the accessors of Validator. More...
 
class  Error
 All errors derive from this one. More...
 
class  ExcludesError
 Thrown when an excludes option is present. More...
 
class  ExtrasError
 Thrown when too many positionals or options are found. More...
 
class  FileError
 Thrown when parsing an INI file and it is missing. More...
 
class  Formatter
 
class  FormatterBase
 
class  FormatterLambda
 This is a specialty override for lambda functions. More...
 
class  HorribleError
 
class  IncorrectConstruction
 Thrown when an option is set to conflicting values (non-vector and multi args, for example) More...
 
class  InvalidError
 Thrown when validation fails before parsing. More...
 
struct  is_bool
 Check to see if something is bool (fail check by default) More...
 
struct  is_bool< bool >
 Check to see if something is bool (true if actually a bool) More...
 
struct  is_copyable_ptr
 Check to see if something is copyable pointer. More...
 
struct  is_shared_ptr
 Check to see if something is a shared pointer. More...
 
struct  is_shared_ptr< const std::shared_ptr< T > >
 Check to see if something is a shared pointer (True if really a shared pointer) More...
 
struct  is_shared_ptr< std::shared_ptr< T > >
 Check to see if something is a shared pointer (True if really a shared pointer) More...
 
struct  is_vector
 Check to see if something is a vector (fail check by default) More...
 
struct  is_vector< std::vector< T, A > >
 Check to see if something is a vector (true if actually a vector) More...
 
class  IsMember
 Verify items are in a set. More...
 
struct  IsMemberType
 This can be specialized to override the type deduction for IsMember. More...
 
struct  IsMemberType< const char * >
 The main custom type needed here is const char * should be a string. More...
 
struct  make_void
 A copy of std::void_t from C++17 (helper for C++11 and C++14) More...
 
class  Option
 
class  Option_group
 Extension of App to better manage groups of options. More...
 
class  OptionAlreadyAdded
 Thrown when an option already exists. More...
 
class  OptionBase
 
class  OptionDefaults
 
class  OptionNotFound
 Thrown when counting a non-existent option. More...
 
class  ParseError
 Anything that can error in Parse. More...
 
class  Range
 Produce a range (factory). Min and max are inclusive. More...
 
class  RequiredError
 Thrown when a required option is missing. More...
 
class  RequiresError
 Thrown when a requires option is missing. More...
 
class  RuntimeError
 Does not output a diagnostic in CLI11_PARSE, but allows to return from main() with a specific error code. More...
 
class  Success
 This is a successful completion on parsing, supposed to exit. More...
 
class  Transformer
 Translate named items to other or a value set. More...
 
class  ValidationError
 Thrown when validation of results fails. More...
 
class  Validator
 Some validators that are provided. More...
 

Typedefs

template<bool B, class T = void>
using enable_if_t = typename std::enable_if< B, T >::type
 
template<typename... Ts>
using void_t = typename make_void< Ts... >::type
 A copy of std::void_t from C++17 - same reasoning as enable_if_t, it does not hurt to redefine. More...
 
template<bool B, class T , class F >
using conditional_t = typename std::conditional< B, T, F >::type
 A copy of std::conditional_t from C++14 - same reasoning as enable_if_t, it does not hurt to redefine. More...
 
using results_t = std::vector< std::string >
 
using callback_t = std::function< bool(results_t)>
 
using Option_p = std::unique_ptr< Option >
 
using App_p = std::shared_ptr< App >
 

Enumerations

enum  ExitCodes {
  Success = 0, IncorrectConstruction = 100, BadNameString, OptionAlreadyAdded,
  FileError, ConversionError, ValidationError, RequiredError,
  RequiresError, ExcludesError, ExtrasError, ConfigError,
  InvalidError, HorribleError, OptionNotFound, ArgumentMismatch,
  BaseClass = 127
}
 
enum  AppFormatMode { Normal, All, Sub }
 
enum  MultiOptionPolicy : char { Throw, TakeLast, TakeFirst, Join }
 

Functions

void TriggerOn (App *trigger_app, App *app_to_enable)
 Helper function to enable one option group/subcommand when another is used. More...
 
void TriggerOn (App *trigger_app, std::vector< App *> apps_to_enable)
 Helper function to enable one option group/subcommand when another is used. More...
 
void TriggerOff (App *trigger_app, App *app_to_enable)
 Helper function to disable one option group/subcommand when another is used. More...
 
void TriggerOff (App *trigger_app, std::vector< App *> apps_to_enable)
 Helper function to disable one option group/subcommand when another is used. More...
 
template<typename T >
using TransformPairs = std::vector< std::pair< std::string, T > >
 definition of the default transformation object More...
 
const detail::ExistingFileValidator ExistingFile
 Check for existing file (returns error message if check fails) More...
 
const detail::ExistingDirectoryValidator ExistingDirectory
 Check for an existing directory (returns error message if check fails) More...
 
const detail::ExistingPathValidator ExistingPath
 Check for an existing path. More...
 
const detail::NonexistentPathValidator NonexistentPath
 Check for an non-existing path. More...
 
const detail::IPV4Validator ValidIPV4
 Check for an IP4 address. More...
 
const detail::PositiveNumber PositiveNumber
 Check for a positive number. More...
 
const detail::Number Number
 Check for a number. More...
 
std::string ignore_case (std::string item)
 Helper function to allow ignore_case to be passed to IsMember or Transform. More...
 
std::string ignore_underscore (std::string item)
 Helper function to allow ignore_underscore to be passed to IsMember or Transform. More...
 
std::string ignore_space (std::string item)
 Helper function to allow checks to ignore spaces to be passed to IsMember or Transform. More...
 

Typedef Documentation

◆ App_p

using App_p = std::shared_ptr<App>

Definition at line 3689 of file CLI11.hpp.

◆ callback_t

using callback_t = std::function<bool(results_t)>

Definition at line 2666 of file CLI11.hpp.

◆ conditional_t

using conditional_t = typename std::conditional<B, T, F>::type

A copy of std::conditional_t from C++14 - same reasoning as enable_if_t, it does not hurt to redefine.

Definition at line 927 of file CLI11.hpp.

◆ enable_if_t

using enable_if_t = typename std::enable_if<B, T>::type

A copy of enable_if_t from C++14, compatible with C++11.

We could check to see if C++14 is being used, but it does not hurt to redefine this (even Google does this: https://github.com/google/skia/blob/master/include/private/SkTLogic.h) It is not in the std namespace anyway, so no harm done.

Definition at line 918 of file CLI11.hpp.

◆ Option_p

using Option_p = std::unique_ptr<Option>

Definition at line 2671 of file CLI11.hpp.

◆ results_t

using results_t = std::vector<std::string>

Definition at line 2665 of file CLI11.hpp.

◆ TransformPairs

using TransformPairs = std::vector<std::pair<std::string, T> >

definition of the default transformation object

Definition at line 2122 of file CLI11.hpp.

◆ void_t

using void_t = typename make_void<Ts...>::type

A copy of std::void_t from C++17 - same reasoning as enable_if_t, it does not hurt to redefine.

Definition at line 924 of file CLI11.hpp.

Enumeration Type Documentation

◆ AppFormatMode

enum AppFormatMode
strong

This enum signifies the type of help requested

This is passed in by App; all user classes must accept this as the second argument.

Enumerator
Normal 
All 
Sub 

Definition at line 2505 of file CLI11.hpp.

◆ ExitCodes

enum ExitCodes
strong

These codes are part of every error in CLI. They can be obtained from e using e.exit_code or as a quick shortcut, int values from e.get_error_code().

Enumerator
Success 
IncorrectConstruction 
BadNameString 
OptionAlreadyAdded 
FileError 
ConversionError 
ValidationError 
RequiredError 
RequiresError 
ExcludesError 
ExtrasError 
ConfigError 
InvalidError 
HorribleError 
OptionNotFound 
ArgumentMismatch 
BaseClass 

Definition at line 607 of file CLI11.hpp.

◆ MultiOptionPolicy

enum MultiOptionPolicy : char
strong
Enumerator
Throw 
TakeLast 
TakeFirst 
Join 

Definition at line 2673 of file CLI11.hpp.

Function Documentation

◆ ignore_case()

std::string CLI::ignore_case ( std::string  item)
inline

Helper function to allow ignore_case to be passed to IsMember or Transform.

Definition at line 2258 of file CLI11.hpp.

◆ ignore_space()

std::string CLI::ignore_space ( std::string  item)
inline

Helper function to allow checks to ignore spaces to be passed to IsMember or Transform.

Definition at line 2264 of file CLI11.hpp.

◆ ignore_underscore()

std::string CLI::ignore_underscore ( std::string  item)
inline

Helper function to allow ignore_underscore to be passed to IsMember or Transform.

Definition at line 2261 of file CLI11.hpp.

◆ TriggerOff() [1/2]

void CLI::TriggerOff ( App trigger_app,
App app_to_enable 
)
inline

Helper function to disable one option group/subcommand when another is used.

Definition at line 6377 of file CLI11.hpp.

◆ TriggerOff() [2/2]

void CLI::TriggerOff ( App trigger_app,
std::vector< App *>  apps_to_enable 
)
inline

Helper function to disable one option group/subcommand when another is used.

Definition at line 6384 of file CLI11.hpp.

◆ TriggerOn() [1/2]

void CLI::TriggerOn ( App trigger_app,
App app_to_enable 
)
inline

Helper function to enable one option group/subcommand when another is used.

Definition at line 6356 of file CLI11.hpp.

◆ TriggerOn() [2/2]

void CLI::TriggerOn ( App trigger_app,
std::vector< App *>  apps_to_enable 
)
inline

Helper function to enable one option group/subcommand when another is used.

Definition at line 6363 of file CLI11.hpp.

Variable Documentation

◆ ExistingDirectory

const detail::ExistingDirectoryValidator ExistingDirectory

Check for an existing directory (returns error message if check fails)

Definition at line 1863 of file CLI11.hpp.

◆ ExistingFile

const detail::ExistingFileValidator ExistingFile

Check for existing file (returns error message if check fails)

Definition at line 1860 of file CLI11.hpp.

◆ ExistingPath

const detail::ExistingPathValidator ExistingPath

Check for an existing path.

Definition at line 1866 of file CLI11.hpp.

◆ NonexistentPath

const detail::NonexistentPathValidator NonexistentPath

Check for an non-existing path.

Definition at line 1869 of file CLI11.hpp.

◆ Number

const detail::Number Number

Check for a number.

Definition at line 1878 of file CLI11.hpp.

◆ PositiveNumber

const detail::PositiveNumber PositiveNumber

Check for a positive number.

Definition at line 1875 of file CLI11.hpp.

◆ ValidIPV4

const detail::IPV4Validator ValidIPV4

Check for an IP4 address.

Definition at line 1872 of file CLI11.hpp.