A CommandOption used for providing help information. This option should be used when a program should print help information and terminate without no error. This prevents errors from being indicated if otherwise required command-line options are not specified.
Definition at line 735 of file CommandOption.hpp.
#include <CommandOption.hpp>

Public Member Functions | |
| CommandOptionHelp (const CommandOption::CommandOptionFlag of, const char shOpt, const std::string &loOpt, const std::string &desc) | |
| virtual void | printHelp (std::ostream &out, bool pretty=true)=0 |
| virtual | ~CommandOptionHelp () |
| Destructor. More... | |
Public Member Functions inherited from gnsstk::CommandOption | |
| virtual std::string | checkArguments () |
| CommandOption (const CommandOptionFlag of, const CommandOptionType ot, const char shOpt, const std::string &loOpt, const std::string &desc, const bool req=false, CommandOptionVec &optVectorList=defaultCommandOptionList) | |
| std::ostream & | dumpValue (std::ostream &out) const |
Displays this->value to the stream out. More... | |
| virtual std::string | getArgString () const |
| Returns a string with the argument format. More... | |
| virtual unsigned long | getCount () const |
| std::string | getDescription () const |
| Returns a formatted string with the description of this option. More... | |
| std::string | getFullOptionString () const |
| virtual std::string | getOptionString () const |
| unsigned long | getOrder (unsigned long idx=-1) const |
| const std::vector< std::string > & | getValue () const |
| void | setDescription (const std::string &desc) |
| CommandOption & | setMaxCount (const unsigned long l) |
| struct option | toGetoptLongOption () const |
| Returns a struct option for use with getopt_long. More... | |
| std::string | toGetoptShortOption () const |
| Returns a string for use with getopt. More... | |
| virtual | ~CommandOption () |
| Destructor. More... | |
Additional Inherited Members | |
Public Types inherited from gnsstk::CommandOption | |
| enum | CommandOptionFlag { noArgument = 0, hasArgument = 1 } |
| enum | CommandOptionType { trailingType, stdType, metaType } |
Protected Member Functions inherited from gnsstk::CommandOption | |
| CommandOption () | |
| Default Constructor. More... | |
Protected Attributes inherited from gnsstk::CommandOption | |
| unsigned long | count |
| std::string | description |
| The description for the help text. More... | |
| std::string | longOpt |
| The string for the long option (for example, "--foo"). More... | |
| unsigned long | maxCount |
| CommandOptionFlag | optFlag |
| Flag for determining whether this option has an argument or not. More... | |
| CommandOptionType | optType |
| std::vector< unsigned long > | order |
| The order in which this option was encountered on the command line. More... | |
| CommandOptionParser * | parser |
| bool | required |
| Whether or not this is a required command line option. More... | |
| char | shortOpt |
| The character for the short option (for example, '-f'). More... | |
| std::vector< std::string > | value |
| Any arguments passed with this option get put in here. More... | |
|
inline |
Constructor.
| [in] | of | Specify whether this help option should have arguments or not. Most will not, but allowing arguments allows for things like "--whatis thisthing" to get detailed help on "thisthing". |
| [in] | shOpt | The one character command line option. Set to 0 if unused. |
| [in] | loOpt | The long command option. Set to std::string() if unused. |
| [in] | desc | A string describing what this option does. |
Definition at line 749 of file CommandOption.hpp.
|
inlinevirtual |
Destructor.
Definition at line 757 of file CommandOption.hpp.
|
pure virtual |
Print the requested help information.
| [in] | out | The stream to which the help text will be printed. |
| [in] | pretty | If true, use "pretty print" as appropriate (dependent on child class implementation as to how it's used). |
Implemented in CommandOptionHelpTimeSystem, gnsstk::CommandOptionNavEnumHelp, gnsstk::CommandOptionHelpSimple, gnsstk::CommandOptionHelpUsage, CommandOptionHelpTestArg, and CommandOptionHelpTest.