class CliCommand

The class for the CLI command. More...

Definition#include <cli_command.hh>
Inherited byCliPipe
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods


Detailed Description

 CliCommand (CliCommand *init_parent_command, const char *init_command_name, const char *init_command_help)

CliCommand

Constructor for a given parent command, command name, and command help.

Parameters:
init_parent_commandthe parent CliCommand command.
init_command_namethe command name (this name should not include the command name of the parent command and its ancestors).
init_command_helpthe command help.

 ~CliCommand ()

~CliCommand

[virtual]

Destructor

void  set_allow_cd (bool v, const char *init_cd_prompt)

set_allow_cd

Enable/disable whether this command allows "change directory" to it.

Parameters:
vif true, enable "change directory", otherwise disable it.
init_cd_promptif v is true, the CLI prompt to display when "cd" to this command. If NULL, the CLI prompt will not be changed.

int  create_default_cli_commands ()

create_default_cli_commands

Create the default CLI commands at each level of the command tree.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  add_pipes ()

add_pipes

Create and add the default CLI pipe commands.

Returns: XORP_OK on success, otherwise XORP_ERROR.

CliCommandadd_command (const char *init_command_name, const char *init_command_help)

add_command

Add a child CLI command.

By default, we cannot "cd" to this command.

Parameters:
init_command_namethe command name to add. It can include more than one command levels in the middle. E.g., "show version pim". However, commands "show" and "show version" must have been installed first.
init_command_helpthe command help.

Returns: the new child command on success, otherwise NULL.

CliCommandadd_command (const char *init_command_name, const char *init_command_help, const char *init_cd_prompt)

add_command

Add a child CLI command we can "cd" to it.

By default, we can "cd" to this command.

Parameters:
init_command_namethe command name to add. It can include more than one command levels in the middle. E.g., "set pim bsr". However, commands "set" and "set pim" must have been installed first.
init_command_helpthe command help.
init_cd_promptif not NULL, the CLI prompt when "cd" to this command.

Returns: the enw child command on success, otherwise NULL.

CliCommandadd_command (const char *init_command_name, const char *init_command_help, const CLI_PROCESS_CALLBACK &init_cli_process_callback)

add_command

Add a child command with a callback.

Parameters:
init_command_namethe command name to add. It can include more than one command levels in the middle. E.g., "show version pim". However, commands "show" and "show version" must have been installed first.
init_command_helpthe command help.
init_cli_process_callbackthe callback to call when the command is entered for execution from the command-line.

Returns: the new child command on success, otherwise NULL.

CliCommandadd_command (const char *init_command_name, const char *init_command_help, CLI_PROCESS_FUNC init_cli_process_func)

add_command

Add a child command with a processing function.

Parameters:
init_command_namethe command name to add. It can include more than one command levels in the middle. E.g., "show version pim". However, commands "show" and "show version" must have been installed first.
init_command_helpthe command help.
init_cli_process_functhe processing function to call when the command is entered for execution from the command-line.

Returns: the new child command on success, otherwise NULL.

int  add_command (CliCommand *child_command)

add_command

Add a child command.

Parameters:
child_commandthe child command to add.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  delete_command (CliCommand *child_command)

delete_command

Delete a child command and all sub-commands below it.

Parameters:
child_commandthe child command to delete.

Returns: XORP_OK on success, otherwise XORP_ERROR.

int  delete_command (const char *delete_command_name)

delete_command

Delete a child command and all sub-commands below it.

Parameters:
delete_command_namethe name of the child command to delete. The name can be the full path-name for that command.

Returns: XORP_OK on success, otherwise XORP_ERROR.

void  delete_all_commands ()

delete_all_commands

Recursively delete all children of this command.

void  set_can_pipe (bool v)

set_can_pipe

Set whether the output of this command can be piped.

Parameters:
vif true, then the the output of this command can be piped.

const char * global_name ()

global_name

[const]

Get the global name of this command (i.e., the full name starting from the root).

Returns: the global (full) name of this command.

void  set_global_name (const char *v)

set_global_name

Set the global name for this command.

Parameters:
vthe global name value to set.

const char * server_name ()

server_name

[const]

Get the server (i.e., processor) name for this command.

Returns: if valid, the server name for this command, otherwise NULL.

void  set_server_name (const char *v)

set_server_name

Set the server (i.e., processor) name for this command.

Parameters:
vthe server name value to set.

void  set_dynamic_children (DYNAMIC_CHILDREN_CALLBACK dc_cb)

set_dynamic_children

void  set_dynamic_process_callback (const CLI_PROCESS_CALLBACK& v)

set_dynamic_process_callback

const CLI_PROCESS_CALLBACK&  dynamic_process_callback ()

dynamic_process_callback

[const]

void  set_cli_process_callback (const CLI_PROCESS_CALLBACK& v)

set_cli_process_callback

[protected]


Generated by: pavlin on possum.icir.org on Thu Nov 6 23:46:55 2003, using kdoc 2.0a54+XORP.