Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
vtkCLIOptions Class Reference

command line options manager More...

#include <vtkCLIOptions.h>

Inheritance diagram for vtkCLIOptions:
Inheritance graph
[legend]
Collaboration diagram for vtkCLIOptions:
Collaboration graph
[legend]

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::stringGetLastErrorMessage () 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)
 
vtkCommandGetCommand (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)
 
vtkCommandGetCommand (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 vtkCLIOptionsNew ()
 
static int IsTypeOf (const char *type)
 
static vtkCLIOptionsSafeDownCast (vtkObject *o)
 
static vtkCLIOptionsNew (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 vtkObjectNew ()
 
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 vtkObjectBaseNew ()
 
static vtkObjectBaseNew ()
 

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
 

Detailed Description

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.

Member Typedef Documentation

◆ Superclass

Definition at line 50 of file vtkCLIOptions.h.

Constructor & Destructor Documentation

◆ vtkCLIOptions()

vtkCLIOptions::vtkCLIOptions ( )
protected

◆ ~vtkCLIOptions()

vtkCLIOptions::~vtkCLIOptions ( )
overrideprotected

Member Function Documentation

◆ New() [1/2]

static vtkCLIOptions* vtkCLIOptions::New ( )
static

◆ GetClassName()

virtual const char* vtkCLIOptions::GetClassName ( )
virtual

◆ IsTypeOf()

static int vtkCLIOptions::IsTypeOf ( const char *  type)
static

◆ IsA()

virtual int vtkCLIOptions::IsA ( const char *  type)
virtual

Reimplemented from vtkObjectBase.

◆ SafeDownCast()

static vtkCLIOptions* vtkCLIOptions::SafeDownCast ( vtkObject o)
static

◆ PrintSelf()

void vtkCLIOptions::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
overridevirtual

Reimplemented from vtkObject.

◆ New() [2/2]

static vtkCLIOptions* vtkCLIOptions::New ( const std::shared_ptr< CLI::App > &  app)
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.

◆ GetCLI11App()

CLI::App* vtkCLIOptions::GetCLI11App ( ) const

Returns the CLI::App reference that can be used to populate command line options.

◆ GetHelp()

const char* vtkCLIOptions::GetHelp ( ) const

Returns the help string.

◆ SetName()

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.

◆ GetName()

const char* vtkCLIOptions::GetName ( ) const

Get/Set the application name to use.

If none specified, one is set using the arguments passed to Parse.

◆ SetDescription()

void vtkCLIOptions::SetDescription ( const char *  desc)

Get/Set the application description to use.

◆ GetDescription()

const char* vtkCLIOptions::GetDescription ( ) const

Get/Set the application description to use.

◆ SetAllowExtras()

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.

◆ GetAllowExtras()

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.

◆ SetStopOnUnrecognizedArgument()

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.

◆ GetStopOnUnrecognizedArgument()

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.

◆ SetGenerateWarnings()

virtual void vtkCLIOptions::SetGenerateWarnings ( bool  )
virtual

When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.

See also
SetConvertInvalidShortNamesToLong

◆ GetGenerateWarnings()

virtual bool vtkCLIOptions::GetGenerateWarnings ( )
virtual

When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.

See also
SetConvertInvalidShortNamesToLong

◆ GenerateWarningsOn()

virtual void vtkCLIOptions::GenerateWarningsOn ( )
virtual

When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.

See also
SetConvertInvalidShortNamesToLong

◆ GenerateWarningsOff()

virtual void vtkCLIOptions::GenerateWarningsOff ( )
virtual

When set to true (default), warnings messages are generated with incorrectly named short arguments are automatically converted to long arguments.

See also
SetConvertInvalidShortNamesToLong

◆ SetHandleLegacyArgumentFormats()

virtual void vtkCLIOptions::SetHandleLegacyArgumentFormats ( bool  )
virtual

When set to true (default), attempts to convert legacy forms of argument specifications in Parse.

Currently, the following cases are supported:

  • Invalid short flags/options for the from -name are converted to --name.
  • Equals (=) 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.

◆ GetHandleLegacyArgumentFormats()

virtual bool vtkCLIOptions::GetHandleLegacyArgumentFormats ( )
virtual

When set to true (default), attempts to convert legacy forms of argument specifications in Parse.

Currently, the following cases are supported:

  • Invalid short flags/options for the from -name are converted to --name.
  • Equals (=) 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.

◆ HandleLegacyArgumentFormatsOn()

virtual void vtkCLIOptions::HandleLegacyArgumentFormatsOn ( )
virtual

When set to true (default), attempts to convert legacy forms of argument specifications in Parse.

Currently, the following cases are supported:

  • Invalid short flags/options for the from -name are converted to --name.
  • Equals (=) 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.

◆ HandleLegacyArgumentFormatsOff()

virtual void vtkCLIOptions::HandleLegacyArgumentFormatsOff ( )
virtual

When set to true (default), attempts to convert legacy forms of argument specifications in Parse.

Currently, the following cases are supported:

  • Invalid short flags/options for the from -name are converted to --name.
  • Equals (=) 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.

◆ Parse()

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.

◆ GetExtraArguments()

const std::vector<std::string>& vtkCLIOptions::GetExtraArguments ( ) const
inline

Returns unparsed / extra arguments left over from the most reset Parse call.

Definition at line 167 of file vtkCLIOptions.h.

◆ GetLastErrorMessage()

const std::string& vtkCLIOptions::GetLastErrorMessage ( ) const
inline

Returns error message from the most recent call to Parse, if any.

Definition at line 173 of file vtkCLIOptions.h.

◆ GetHelpRequested()

virtual bool vtkCLIOptions::GetHelpRequested ( )
virtual

Returns true of help was requested in the most recent call to Parse.

◆ GetUsage()

std::string vtkCLIOptions::GetUsage ( ) const

Returns usage string.


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