From 9eebf97e3d3fe8bff0d3c5ecdae39f15bd93f40b Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 4 Oct 2022 13:30:04 +0200 Subject: 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 --- lib/command_match.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/command_match.c') diff --git a/lib/command_match.c b/lib/command_match.c index f221e0a02c..ce2dbc9528 100644 --- a/lib/command_match.c +++ b/lib/command_match.c @@ -395,8 +395,7 @@ enum matcher_rv command_complete(struct graph *graph, vector vline, for (ALL_LIST_ELEMENTS_RO(current, node, gstack)) { struct cmd_token *token = gstack[0]->data; - if (token->attr == CMD_ATTR_HIDDEN - || token->attr == CMD_ATTR_DEPRECATED) + if (token->attr & CMD_ATTR_HIDDEN) continue; enum match_type minmatch = min_match_level(token->type); -- cgit v1.2.3