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.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lib/command.h') diff --git a/lib/command.h b/lib/command.h index fd686af943..46763ed0d1 100644 --- a/lib/command.h +++ b/lib/command.h @@ -358,9 +358,13 @@ struct cmd_node { DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, CMD_ATTR_HIDDEN, \ 0) +/* note: DEPRECATED implies HIDDEN, and other than that there is currently no + * difference. It's purely for expressing intent in the source code - a + * DEPRECATED command is supposed to go away, a HIDDEN one is likely to stay. + */ #define ALIAS_DEPRECATED(funcname, cmdname, cmdstr, helpstr) \ DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, \ - CMD_ATTR_DEPRECATED, 0) + CMD_ATTR_DEPRECATED | CMD_ATTR_HIDDEN, 0) #define ALIAS_YANG(funcname, cmdname, cmdstr, helpstr) \ DEFUN_CMD_ELEMENT(funcname, cmdname, cmdstr, helpstr, CMD_ATTR_YANG, 0) -- cgit v1.2.3