From 90c8406c209a698ecc28c80ad7ebced13a84e3e8 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Thu, 26 Aug 2021 11:43:08 +0200 Subject: 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 --- lib/command.c | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 422544b70b..3537585cc4 100644 --- a/lib/command.c +++ b/lib/command.c @@ -74,6 +74,7 @@ const struct message tokennames[] = { item(JOIN_TKN), item(START_TKN), item(END_TKN), + item(NEG_ONLY_TKN), {0}, }; /* clang-format on */ -- cgit v1.2.3