Syntax of the cmdparser( ) function

The cmdparser(<target-function>, <syntax>, <msg>) function creates commands that you can use in your vShell instance.

As indicated in Implementation flow for vShell extensions, cmdparser( ) requires a target function.

<target-function>

Specifies the name of the function called by cmdparser( ).

<syntax> = "<vSLX-command-name>:<keyword>|<argument>:<keyword>|<argument>: ..."

Enclose the <syntax> element in quotes ("). The first word of the <syntax> element is the name of the vShell command you are creating, followed by the required keywords and arguments.

There is no special format for keywords. For each argument, you specify a type symbol, as follows:

Table 1. vShell data types

Data type

Type symbol

String

%s

Integer

%d

IP address

%i

MAC address

%m or %M

Interface port

%I

For example, the syntax of the vShell create link command is "create:link:%s:%I%s:%I". The elements of this command are as follows:
  • Command name—create
  • Keyword—link
  • Arguments (separate by colons)—%s:%I%s:%I
Sample CLI input by vShell user:
create link rt1 0/1 rt2 0/1

<msg>

Specifies the CLI Help displayed when a user types ?.

Enclose the <msg> element in quotes (").
"Creates a link between two entities."