]> git.proxmox.com Git - mirror_frr.git/commit - lib/command.c
lib: add `![...]` syntax for easy "no" forms
authorDavid Lamparter <equinox@opensourcerouting.org>
Thu, 26 Aug 2021 09:43:08 +0000 (11:43 +0200)
committerDavid Lamparter <equinox@opensourcerouting.org>
Thu, 26 Aug 2021 19:03:44 +0000 (21:03 +0200)
commit90c8406c209a698ecc28c80ad7ebced13a84e3e8
tree74bedac5f4d8c3bc5b1bdfb42e6eefaa001d714c
parent3e324ff41921c719de3aabc4136546828416532f
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>
12 files changed:
doc/developer/cli.rst
lib/command.c
lib/command_graph.c
lib/command_graph.h
lib/command_lex.l
lib/command_match.c
lib/command_parse.y
lib/command_py.c
tests/lib/cli/test_cli.c
tests/lib/cli/test_cli.in
tests/lib/cli/test_cli.refout.in
tools/permutations.c