#include <CommandLine.h>
Public Member Functions | |
CommandLineOption (const String &name, const String &shortName, const Visibility &useWithCommands, const String &help) | |
~CommandLineOption () override=default | |
bool | hasValue () const override |
CommandLineElement::Type | type () const override |
String | printableName () const override |
Public Member Functions inherited from sptk::CommandLine::CommandLineElement | |
CommandLineElement (const String &name, const String &shortName, const String &help, const Visibility &useWithCommands) | |
virtual | ~CommandLineElement ()=default |
virtual Type | type () const |
virtual String | name () const |
virtual String | shortName () const |
virtual bool | hasValue () const |
virtual void | validate (const String &value) const |
virtual String | printableName () const |
bool | useWithCommand (const String &command) const |
void | formatHelp (size_t textWidth, Strings &formattedText) const |
void | printHelp (size_t nameWidth, size_t textWidth, const String &optionDefaultValue) const |
Additional Inherited Members | |
Public Types inherited from sptk::CommandLine::CommandLineElement | |
enum class | Type { IS_UNKNOWN , IS_COMMAND , IS_OPTION , IS_VALUE_OPTION } |
Command line option
Command line argument that starts from '-' character and doesn't expect a value. It may have a long name that starts from '–', and/or a short name, that starts from '-'.
sptk::CommandLine::CommandLineOption::CommandLineOption | ( | const String & | name, |
const String & | shortName, | ||
const Visibility & | useWithCommands, | ||
const String & | help | ||
) |
Constructor
name | Element name |
shortName | Short element name (single character, options only) |
useWithCommands | Element visibility for a command (options only) |
help | Help (description) for the element |
|
overridedefault |
Destructor
|
overridevirtual |
Returns true if element expects value
Reimplemented from sptk::CommandLine::CommandLineElement.
|
overridevirtual |
Returns element name in help print format
Reimplemented from sptk::CommandLine::CommandLineElement.
|
overridevirtual |
Returns element type
Reimplemented from sptk::CommandLine::CommandLineElement.