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
This commit is contained in:
Neels Hofmeyr 2018-09-24 18:39:00 +02:00
parent a7557fe0f5
commit 5398911ddb
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}