command line options manager More...
#include <vtkCLIOptions.h>
Public Types | |
typedef vtkObject | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) override |
CLI::App * | GetCLI11App () const |
Returns the CLI::App reference that can be used to populate command line options. More... | |
const char * | GetHelp () const |
Returns the help string. More... | |
bool | Parse (int &argc, char **&argv) |
Parse command line arguments. More... | |
const std::string & | GetLastErrorMessage () const |
Returns error message from the most recent call to Parse , if any. More... | |
virtual bool | GetHelpRequested () |
Returns true of help was requested in the most recent call to Parse . More... | |
std::string | GetUsage () const |
Returns usage string. More... | |
void | SetName (const char *name) |
Get/Set the application name to use. More... | |
const char * | GetName () const |
Get/Set the application name to use. More... | |
void | SetDescription (const char *desc) |
Get/Set the application description to use. More... | |
const char * | GetDescription () const |
Get/Set the application description to use. More... | |
void | SetAllowExtras (bool val) |
Indicate whether extra arguments should be allowed/ignored. More... | |
bool | GetAllowExtras () const |
Indicate whether extra arguments should be allowed/ignored. More... | |
void | SetStopOnUnrecognizedArgument (bool val) |
Indicate whether the parsing should stop as soon as the first unrecognized option is detected. More... | |
bool | GetStopOnUnrecognizedArgument () const |
Indicate whether the parsing should stop as soon as the first unrecognized option is detected. More... | |
virtual void | SetGenerateWarnings (bool) |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments. More... | |
virtual bool | GetGenerateWarnings () |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments. More... | |
virtual void | GenerateWarningsOn () |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments. More... | |
virtual void | GenerateWarningsOff () |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments. More... | |
virtual void | SetHandleLegacyArgumentFormats (bool) |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse . More... | |
virtual bool | GetHandleLegacyArgumentFormats () |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse . More... | |
virtual void | HandleLegacyArgumentFormatsOn () |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse . More... | |
virtual void | HandleLegacyArgumentFormatsOff () |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse . More... | |
const std::vector< std::string > & | GetExtraArguments () const |
Returns unparsed / extra arguments left over from the most reset Parse call. More... | |
Public Member Functions inherited from vtkObject | |
vtkBaseTypeMacro (vtkObject, vtkObjectBase) | |
virtual void | DebugOn () |
virtual void | DebugOff () |
bool | GetDebug () |
void | SetDebug (bool debugFlag) |
virtual void | Modified () |
virtual vtkMTimeType | GetMTime () |
void | RemoveObserver (unsigned long tag) |
void | RemoveObservers (unsigned long event) |
void | RemoveObservers (const char *event) |
void | RemoveAllObservers () |
int | HasObserver (unsigned long event) |
int | HasObserver (const char *event) |
int | InvokeEvent (unsigned long event) |
int | InvokeEvent (const char *event) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
unsigned long | AddObserver (unsigned long event, vtkCommand *, float priority=0.0f) |
unsigned long | AddObserver (const char *event, vtkCommand *, float priority=0.0f) |
vtkCommand * | GetCommand (unsigned long tag) |
void | RemoveObserver (vtkCommand *) |
void | RemoveObservers (unsigned long event, vtkCommand *) |
void | RemoveObservers (const char *event, vtkCommand *) |
int | HasObserver (unsigned long event, vtkCommand *) |
int | HasObserver (const char *event, vtkCommand *) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, void(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
unsigned long | AddObserver (unsigned long event, U observer, bool(T::*callback)(vtkObject *, unsigned long, void *), float priority=0.0f) |
int | InvokeEvent (unsigned long event, void *callData) |
int | InvokeEvent (const char *event, void *callData) |
Public Member Functions inherited from vtkObjectBase | |
const char * | GetClassName () const |
virtual void | Delete () |
virtual void | FastDelete () |
void | Print (ostream &os) |
virtual void | Register (vtkObjectBase *o) |
virtual void | UnRegister (vtkObjectBase *o) |
void | SetReferenceCount (int) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
virtual void | PrintHeader (ostream &os, vtkIndent indent) |
virtual void | PrintTrailer (ostream &os, vtkIndent indent) |
int | GetReferenceCount () |
void | PrintRevisions (ostream &) |
Static Public Member Functions | |
static vtkCLIOptions * | New () |
static int | IsTypeOf (const char *type) |
static vtkCLIOptions * | SafeDownCast (vtkObject *o) |
static vtkCLIOptions * | New (const std::shared_ptr< CLI::App > &app) |
Use this overload of New to use an existing CLI::App instance. More... | |
Static Public Member Functions inherited from vtkObject | |
static vtkObject * | New () |
static void | BreakOnError () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
static void | SetGlobalWarningDisplay (int val) |
static void | GlobalWarningDisplayOn () |
static void | GlobalWarningDisplayOff () |
static int | GetGlobalWarningDisplay () |
Static Public Member Functions inherited from vtkObjectBase | |
static vtkTypeBool | IsTypeOf (const char *name) |
static vtkObjectBase * | New () |
static vtkObjectBase * | New () |
Protected Member Functions | |
vtkCLIOptions () | |
~vtkCLIOptions () override | |
Protected Member Functions inherited from vtkObject | |
vtkObject () | |
virtual | ~vtkObject () |
void | RegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | UnRegisterInternal (vtkObjectBase *, vtkTypeBool check) VTK_OVERRIDE |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
void | InternalGrabFocus (vtkCommand *mouseEvents, vtkCommand *keypressEvents=NULL) |
void | InternalReleaseFocus () |
Protected Member Functions inherited from vtkObjectBase | |
vtkObjectBase () | |
virtual | ~vtkObjectBase () |
virtual void | CollectRevisions (ostream &) |
virtual void | ReportReferences (vtkGarbageCollector *) |
vtkObjectBase (const vtkObjectBase &) | |
void | operator= (const vtkObjectBase &) |
Additional Inherited Members | |
Protected Attributes inherited from vtkObject | |
bool | Debug |
vtkTimeStamp | MTime |
vtkSubjectHelper * | SubjectHelper |
Protected Attributes inherited from vtkObjectBase | |
vtkAtomicInt32 | ReferenceCount |
vtkWeakPointerBase ** | WeakPointers |
command line options manager
vtkCLIOptions handles command line arguments processing in ParaView. To use, create a vtkCLIOptions
instance, populate it with available arguments and then call Parse
. Various modules in ParaView offer ways of populating vtkCLIOptions instance with supported command line arguments. For example:
Applications can add custom configuration classes that expose new command line options and configuration parameters.
ParaView uses CLI11 for the processing on command line arguments. The CLI11 App can be accessed using GetCLI11App
. vtkCLIOptions automatically creates a CLI::App
on instantiation. One can also pass it an existing app using vtkCLIOptions::New(app)
.
Definition at line 46 of file vtkCLIOptions.h.
typedef vtkObject vtkCLIOptions::Superclass |
Definition at line 50 of file vtkCLIOptions.h.
|
protected |
|
overrideprotected |
|
static |
|
virtual |
Reimplemented from vtkObjectBase.
|
static |
|
overridevirtual |
Reimplemented from vtkObject.
|
static |
Use this overload of New
to use an existing CLI::App instance.
The app will not be initialized i.e. the formatter, AllowExtras
and StopOnUnrecognizedArgument
state etc. will be left unchanged.
CLI::App* vtkCLIOptions::GetCLI11App | ( | ) | const |
Returns the CLI::App
reference that can be used to populate command line options.
const char* vtkCLIOptions::GetHelp | ( | ) | const |
Returns the help string.
void vtkCLIOptions::SetName | ( | const char * | name | ) |
Get/Set the application name to use.
If none specified, one is set using the arguments passed to Parse
.
const char* vtkCLIOptions::GetName | ( | ) | const |
Get/Set the application name to use.
If none specified, one is set using the arguments passed to Parse
.
void vtkCLIOptions::SetDescription | ( | const char * | desc | ) |
Get/Set the application description to use.
const char* vtkCLIOptions::GetDescription | ( | ) | const |
Get/Set the application description to use.
void vtkCLIOptions::SetAllowExtras | ( | bool | val | ) |
Indicate whether extra arguments should be allowed/ignored.
Unparsed arguments can be obtained using GetExtraArguments
.
Forwards to CLI::App::allow_extras
.
By default, this is set to true.
bool vtkCLIOptions::GetAllowExtras | ( | ) | const |
Indicate whether extra arguments should be allowed/ignored.
Unparsed arguments can be obtained using GetExtraArguments
.
Forwards to CLI::App::allow_extras
.
By default, this is set to true.
void vtkCLIOptions::SetStopOnUnrecognizedArgument | ( | bool | val | ) |
Indicate whether the parsing should stop as soon as the first unrecognized option is detected.
Setting this to false implies to ignore the "AllowExtras" status.
Forwards to CLI::App::prefix_command
by inverting the provided boolean. Note there seem to be an issue in the documentation for CLI::App::prefix_command
See https://github.com/CLIUtils/CLI11/issues/1052 for more information.
By default, this is set to false.
bool vtkCLIOptions::GetStopOnUnrecognizedArgument | ( | ) | const |
Indicate whether the parsing should stop as soon as the first unrecognized option is detected.
Setting this to false implies to ignore the "AllowExtras" status.
Forwards to CLI::App::prefix_command
by inverting the provided boolean. Note there seem to be an issue in the documentation for CLI::App::prefix_command
See https://github.com/CLIUtils/CLI11/issues/1052 for more information.
By default, this is set to false.
|
virtual |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.
|
virtual |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.
|
virtual |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.
|
virtual |
When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.
|
virtual |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse
.
Currently, the following cases are supported:
-name
are converted to --name
.=
) used as separator between short option name and its value is replaced by a space ().If GenerateWarnings
is true, a warning is raised when any option is convert thusly.
Note, these conversions are only performed till the first positional separator, --
, is detected. All arguments after the first positional separator are left unchanged.
|
virtual |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse
.
Currently, the following cases are supported:
-name
are converted to --name
.=
) used as separator between short option name and its value is replaced by a space ().If GenerateWarnings
is true, a warning is raised when any option is convert thusly.
Note, these conversions are only performed till the first positional separator, --
, is detected. All arguments after the first positional separator are left unchanged.
|
virtual |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse
.
Currently, the following cases are supported:
-name
are converted to --name
.=
) used as separator between short option name and its value is replaced by a space ().If GenerateWarnings
is true, a warning is raised when any option is convert thusly.
Note, these conversions are only performed till the first positional separator, --
, is detected. All arguments after the first positional separator are left unchanged.
|
virtual |
When set to true (default), attempts to convert legacy forms of argument specifications in Parse
.
Currently, the following cases are supported:
-name
are converted to --name
.=
) used as separator between short option name and its value is replaced by a space ().If GenerateWarnings
is true, a warning is raised when any option is convert thusly.
Note, these conversions are only performed till the first positional separator, --
, is detected. All arguments after the first positional separator are left unchanged.
bool vtkCLIOptions::Parse | ( | int & | argc, |
char **& | argv | ||
) |
Parse command line arguments.
Returns true on success else false.
If HandleLegacyArgumentFormats is true, -option
are converted to --option
until the first positional separator is encountered. Likewise, -l=foo
is split as -l foo
.
If GenerateWarnings is true, a warning message is generated for each such converted option.
|
inline |
Returns unparsed / extra arguments left over from the most reset Parse
call.
Definition at line 167 of file vtkCLIOptions.h.
|
inline |
Returns error message from the most recent call to Parse
, if any.
Definition at line 173 of file vtkCLIOptions.h.
|
virtual |
Returns true of help was requested in the most recent call to Parse
.
std::string vtkCLIOptions::GetUsage | ( | ) | const |
Returns usage string.