HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pxr_CLI::CLI::Formatter Class Reference

#include <CLI11.h>

+ Inheritance diagram for pxr_CLI::CLI::Formatter:

Public Member Functions

 Formatter ()=default
 
 Formatter (const Formatter &)=default
 
 Formatter (Formatter &&)=default
 
Formatteroperator= (const Formatter &)=default
 
Formatteroperator= (Formatter &&)=default
 
Overridables
virtual CLI11_NODISCARD std::string make_group (std::string group, bool is_positional, std::vector< const Option * > opts) const
 
virtual std::string make_positionals (const App *app) const
 This prints out just the positionals "group". More...
 
std::string make_groups (const App *app, AppFormatMode mode) const
 This prints out all the groups of options. More...
 
virtual std::string make_subcommands (const App *app, AppFormatMode mode) const
 This prints out all the subcommands. More...
 
virtual std::string make_subcommand (const App *sub) const
 This prints out a subcommand. More...
 
virtual std::string make_expanded (const App *sub) const
 This prints out a subcommand in help-all. More...
 
virtual std::string make_footer (const App *app) const
 This prints out all the groups of options. More...
 
virtual std::string make_description (const App *app) const
 This displays the description line. More...
 
virtual std::string make_usage (const App *app, std::string name) const
 This displays the usage line. More...
 
std::string make_help (const App *, std::string, AppFormatMode) const override
 This puts everything together. More...
 
Options
virtual std::string make_option (const Option *opt, bool is_positional) const
 This prints out an option help line, either positional or optional form. More...
 
virtual std::string make_option_name (const Option *, bool) const
 This is the name part of an option, Default: left column. More...
 
virtual std::string make_option_opts (const Option *) const
 This is the options part of the name, Default: combined into left column. More...
 
virtual std::string make_option_desc (const Option *) const
 This is the description. Default: Right column, on new line if left column too large. More...
 
virtual std::string make_option_usage (const Option *opt) const
 This is used to print the name on the USAGE line. More...
 
- Public Member Functions inherited from pxr_CLI::CLI::FormatterBase
 FormatterBase ()=default
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
 FormatterBase (const FormatterBase &)=default
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
 FormatterBase (FormatterBase &&)=default
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
FormatterBaseoperator= (const FormatterBase &)=default
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
FormatterBaseoperator= (FormatterBase &&)=default
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
virtual ~FormatterBase () noexcept
 Adding a destructor in this form to work around bug in GCC 4.7. More...
 
void label (std::string key, std::string val)
 Set the "REQUIRED" label. More...
 
void column_width (std::size_t val)
 Set the column width. More...
 
CLI11_NODISCARD std::string get_label (std::string key) const
 Get the current value of a name (REQUIRED, etc.) More...
 
CLI11_NODISCARD std::size_t get_column_width () const
 Get the current column width. More...
 

Additional Inherited Members

- Protected Attributes inherited from pxr_CLI::CLI::FormatterBase
std::size_t column_width_ {30}
 The width of the first column. More...
 
std::map< std::string,
std::string
labels_ {}
 The required help printout labels (user changeable) Values are Needs, Excludes, etc. More...
 

Detailed Description

This is the default Formatter for CLI11. It pretty prints help output, and is broken into quite a few overridable methods, to be highly customizable with minimal effort.

Definition at line 4075 of file CLI11.h.

Constructor & Destructor Documentation

pxr_CLI::CLI::Formatter::Formatter ( )
default
pxr_CLI::CLI::Formatter::Formatter ( const Formatter )
default
pxr_CLI::CLI::Formatter::Formatter ( Formatter &&  )
default

Member Function Documentation

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_description ( const App app) const
virtual

This displays the description line.

Definition at line 9433 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_expanded ( const App sub) const
virtual

This prints out a subcommand in help-all.

Definition at line 9581 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_footer ( const App app) const
virtual

This prints out all the groups of options.

Definition at line 9501 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_group ( std::string  group,
bool  is_positional,
std::vector< const Option * >  opts 
) const
virtual

This prints out a group of options with title

Definition at line 9388 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_groups ( const App app,
AppFormatMode  mode 
) const

This prints out all the groups of options.

Definition at line 9409 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_help ( const App app,
std::string  name,
AppFormatMode  mode 
) const
overridevirtual

This puts everything together.

Implements pxr_CLI::CLI::FormatterBase.

Definition at line 9509 of file CLI11.h.

virtual std::string pxr_CLI::CLI::Formatter::make_option ( const Option opt,
bool  is_positional 
) const
inlinevirtual

This prints out an option help line, either positional or optional form.

Definition at line 4123 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_option_desc ( const Option opt) const
virtual

This is the description. Default: Right column, on new line if left column too large.

Definition at line 9643 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_option_name ( const Option opt,
bool  is_positional 
) const
virtual

This is the name part of an option, Default: left column.

Definition at line 9601 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_option_opts ( const Option opt) const
virtual

This is the options part of the name, Default: combined into left column.

Definition at line 9608 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_option_usage ( const Option opt) const
virtual

This is used to print the name on the USAGE line.

Definition at line 9645 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_positionals ( const App app) const
virtual

This prints out just the positionals "group".

Definition at line 9399 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_subcommand ( const App sub) const
virtual

This prints out a subcommand.

Definition at line 9575 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_subcommands ( const App app,
AppFormatMode  mode 
) const
virtual

This prints out all the subcommands.

Definition at line 9533 of file CLI11.h.

CLI11_INLINE std::string pxr_CLI::CLI::Formatter::make_usage ( const App app,
std::string  name 
) const
virtual

This displays the usage line.

Definition at line 9459 of file CLI11.h.

Formatter& pxr_CLI::CLI::Formatter::operator= ( const Formatter )
default
Formatter& pxr_CLI::CLI::Formatter::operator= ( Formatter &&  )
default

The documentation for this class was generated from the following file: