summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeels Hofmeyr <neels@hofmeyr.de>2018-09-24 04:16:42 +0200
committerHarald Welte <laforge@gnumonks.org>2018-09-24 06:40:04 +0000
commita7557fe0f59873f0d50553e2dec5f2903ddaeca6 (patch)
tree1dba9360cd57356e9ab2e2718643ceb6653a0df8 /src
parentcf8def25d59f4453620e109c9f7f033d01fe4583 (diff)
vty list: fix deprecation/hidden bit logic
If a command is both hidden and deprecated, still don't show it for the 'list' command. We currently have no such nodes, as it seems, though. Related: OS#3584 Change-Id: I07ec15cab057a3e09064e0420a69121ee8eb4253
Diffstat (limited to 'src')
-rw-r--r--src/vty/command.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/vty/command.c b/src/vty/command.c
index 900680f7..1e77d13f 100644
--- a/src/vty/command.c
+++ b/src/vty/command.c
@@ -2728,8 +2728,7 @@ gDEFUN(config_list, config_list_cmd, "list", "Print command list\n")
for (i = 0; i < vector_active(cnode->cmd_vector); i++)
if ((cmd = vector_slot(cnode->cmd_vector, i)) != NULL
- && !(cmd->attr == CMD_ATTR_DEPRECATED
- || cmd->attr == CMD_ATTR_HIDDEN))
+ && !(cmd->attr & (CMD_ATTR_DEPRECATED | CMD_ATTR_HIDDEN)))
vty_out(vty, " %s%s", cmd->string, VTY_NEWLINE);
return CMD_SUCCESS;
}