UCommon
Public Member Functions | Static Public Member Functions | Data Fields
ucommon::shell::Option Class Reference

A base class used to create parsable shell options. More...

#include <shell.h>

Inheritance diagram for ucommon::shell::Option:
Inheritance graph
[legend]
Collaboration diagram for ucommon::shell::Option:
Collaboration graph
[legend]

Public Member Functions

virtual char * assign (char *value)=0
 Used to send option into derived receiver.
void disable (void)
 Disable a option.
 Option (char short_option=0, char *long_option=((void *) 0), char *value_type=((void *) 0), char *help=((void *) 0))
 Construct a shell parser option.

Static Public Member Functions

static LinkedObjectfirst (void)
static void reset (void)

Data Fields

char * help_string
char * long_option
char short_option
bool trigger_option
char * uses_option

Detailed Description

A base class used to create parsable shell options.

The virtual is invoked when the shell option is detected. Both short and long forms of argument parsing are supported. An instance of a derived class is created to perform the argument parsing.

Author:
David Sugar dyfet.nosp@m.@gnu.nosp@m.telep.nosp@m.hony.nosp@m..org

Definition at line 337 of file shell.h.


Constructor & Destructor Documentation

ucommon::shell::Option::Option ( char  short_option = 0,
char *  long_option = ((void *) 0),
char *  value_type = ((void *) 0),
char *  help = ((void *) 0) 
)

Construct a shell parser option.

Parameters:
short_optionfor single character code.
long_optionfor extended string.
value_typeif -x value or -long=yyy.
helpstring, future use.

Member Function Documentation

virtual char* ucommon::shell::Option::assign ( char *  value) [pure virtual]

Used to send option into derived receiver.

Parameters:
valueoption that was received.
Returns:
NULL or error string to use.

Implemented in ucommon::shell::counteropt, ucommon::shell::numericopt, ucommon::shell::charopt, and ucommon::shell::stringopt.

Disable a option.

Might happen if argv0 name suggests an option is no longer actively needed.


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