Libecoli 0.11.1
Extensible COmmand LIne library
Loading...
Searching...
No Matches
Command node

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

Macros

#define EC_NODE_CMD(args...)

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)
#define EC_VA_END
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));
#define EC_NODE_CMD(args...)
Definition node_cmd.h:30
struct ec_node * ec_node_str(const char *id, const char *str)
Examples
readline/main.c.

Definition at line 30 of file node_cmd.h.