From 5398911ddb03f994de8bbda73d41810c40fb0245 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Mon, 24 Sep 2018 18:39:00 +0200 Subject: vty: omit HIDDEN from vty reference During 'show online help', the XML vty node dump, omit all commands marked HIDDEN. These commands were already hidden from the VTY reference prior to commit I1f18e0e41da4772d092d71261b9e489dc1598923, because of broken/confusing bit and boolean logic mixup. After that commit, HIDDEN commands end up in the doc. So practically, this patch here brings back the status quo of before above commit, even though the previous code clearly "intended" to list HIDDEN commands in the reference but failed to have that effect. AFAICT the complete list of commands currently hidden is: * osmo-bsc: bts/"training_sequence_code <0-7>", * osmo-bsc: ts/"phys_chan_config PCHAN" for uppercase pchans; * osmo-bts: bts/"rtp bind-ip A.B.C.D" which actually says vty_out(vty, "%% rtp bind-ip is now deprecated%s", VTY_NEWLINE); * osmo-sgsn: 'reset sgsn state' used for SGSN testing. Note that the osmo-sgsn build was broken by including hidden commands in the vty reference, since one of its hidden commands had missing doc strings and made osmotestconfig.py signal failure. This would fix that from the hide-hidden-commands angle, and so would osmo-sgsn commit I8b6e8615e409266910f2f76a10ced9ab33e4de91 from the fix-the-doc-strings angle. Change-Id: I92c3c66ff69c186234276c64478d6342e061d25e --- src/vty/command.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vty/command.c b/src/vty/command.c index 1e77d13f..a540cd5b 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -679,7 +679,7 @@ static int vty_dump_nodes(struct vty *vty) elem = vector_slot(cnode->cmd_vector, j); if (!vty_command_is_common(elem)) continue; - if (!(elem->attr & CMD_ATTR_DEPRECATED)) + if (!(elem->attr & (CMD_ATTR_DEPRECATED | CMD_ATTR_HIDDEN))) vty_dump_element(elem, vty); } } @@ -717,7 +717,7 @@ static int vty_dump_nodes(struct vty *vty) elem = vector_slot(cnode->cmd_vector, j); if (vty_command_is_common(elem)) continue; - if (!(elem->attr & CMD_ATTR_DEPRECATED)) + if (!(elem->attr & (CMD_ATTR_DEPRECATED | CMD_ATTR_HIDDEN))) vty_dump_element(elem, vty); } -- cgit v1.2.3