summaryrefslogtreecommitdiffstats
path: root/lib/command_py.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2021-08-26 11:43:08 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2021-08-26 21:03:44 +0200
commit90c8406c209a698ecc28c80ad7ebced13a84e3e8 (patch)
tree74bedac5f4d8c3bc5b1bdfb42e6eefaa001d714c /lib/command_py.c
parentMerge pull request #9466 from idryzhov/vrf-netns (diff)
downloadfrr-90c8406c209a698ecc28c80ad7ebced13a84e3e8.tar.xz
frr-90c8406c209a698ecc28c80ad7ebced13a84e3e8.zip
lib: add `![...]` syntax for easy "no" forms
This allows defining a CLI command like this: `[no] some setting ![VALUE]` with VALUE being optional for the "no" form, but required for the positive form. It's just a `[...]` where the empty branch can only be taken for commands starting with `no`. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command_py.c')
-rw-r--r--lib/command_py.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/command_py.c b/lib/command_py.c
index 7f19008fb..37b4dec7b 100644
--- a/lib/command_py.c
+++ b/lib/command_py.c
@@ -210,8 +210,8 @@ static PyObject *graph_to_pyobj(struct wrap_graph *wgraph,
/* plumbing types */
item(FORK_TKN) item(JOIN_TKN) item(START_TKN)
- item(END_TKN) default
- : wrap->type = "???";
+ item(END_TKN) item(NEG_ONLY_TKN) default
+ : wrap->type = "???";
}
wrap->deprecated = (tok->attr == CMD_ATTR_DEPRECATED);