summaryrefslogtreecommitdiffstats
path: root/lib/command_graph.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2022-10-04 13:30:04 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2022-10-06 15:34:32 +0200
commit9eebf97e3d3fe8bff0d3c5ecdae39f15bd93f40b (patch)
tree04b57dbd4183fd0f0b415a022e12cb72e29fdf16 /lib/command_graph.c
parentlib: remove unused CLI macros (diff)
downloadfrr-9eebf97e3d3fe8bff0d3c5ecdae39f15bd93f40b.tar.xz
frr-9eebf97e3d3fe8bff0d3c5ecdae39f15bd93f40b.zip
lib: make cmd_element->attr a bitmask & clarify
It already "looks" like a bitmask, but we currently can't flag a command both YANG and HIDDEN at the same time. It really should be a bitmask. Also clarify DEPRECATED behaviour (or the absence thereof.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command_graph.c')
-rw-r--r--lib/command_graph.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/command_graph.c b/lib/command_graph.c
index 09d802e79..e94068525 100644
--- a/lib/command_graph.c
+++ b/lib/command_graph.c
@@ -494,9 +494,10 @@ void cmd_graph_node_print_cb(struct graph_node *gn, struct buffer *buf)
snprintf(nbuf, sizeof(nbuf), "<b>%s</b>",
lookup_msg(tokennames, tok->type, NULL));
buffer_putstr(buf, nbuf);
- if (tok->attr == CMD_ATTR_DEPRECATED)
+ if (tok->attr & CMD_ATTR_DEPRECATED)
buffer_putstr(buf, " (d)");
- else if (tok->attr == CMD_ATTR_HIDDEN)
+ /* DEPRECATED implies HIDDEN, don't print both */
+ else if (tok->attr & CMD_ATTR_HIDDEN)
buffer_putstr(buf, " (h)");
if (tok->text) {
if (tok->type == WORD_TKN)