Loading...
Searching...
No Matches
Command node
Grammar nodes

A node that parses commands using a format string. More...

Collaboration diagram for Command node:

## Macros

#define | EC_NODE_CMD(args...)
| Create a command node from a format string.

## Detailed Description

A node that parses commands using a format string.

Configuration Schema

schema cmd {
string expr {
description "The expression to match. Supported operators are or '|', list ',', all '&',
many '+', many-or-zero '*', option '[]', group '()'. An identifier
(alphanumeric) can reference a node whose node_id matches. Else it is
interpreted as ec_node_str() matching this string. The ',' operator requires at
least one match, the '&' operator requires all to match (in any order). Example:
command [option] (subset1, subset2) x|y";
}
list children {
description "The list of children nodes.";
node {
description "A child node whose id is referenced in the expression.";
}
}
}

## Macro Definition Documentation

## EC_NODE_CMD

#define EC_NODE_CMD | ( |  | args... | ) |

Value:
__ec_node_cmd(args, EC_VA_END)
EC_VA_END
#define EC_VA_END
Mark the end of the arguments list in some functions.
Definition utils.h:26

Create a command node from a format string.

The format string describes a command grammar using a simple syntax. Child nodes are passed as variadic arguments and referenced by name in the format string.

Example:

EC_NODE_CMD("mycmd", "show NAME", ec_node_str("NAME", NULL));
EC_NODE_CMD
#define EC_NODE_CMD(args...)
Create a command node from a format string.
Definition node_cmd.h:30
ec_node_str
struct ec_node * ec_node_str(const char *id, const char *str)
Create a string node that matches a specific string.

Examples
  readline/main.c.

Definition at line 30 of file node_cmd.h.