From 453e37e3c8322cd200a6f803579c55753e866c7f Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sun, 22 Oct 2017 02:31:33 +0200 Subject: VTY reference: use node names as section names In 'show online-help' output, add the node names (currently all derived from the prompt) as entry, so that in the osmo-gsm-manuals, each section of node commands gets a title. So far, each section of commands has no name at all, and it is entirely up for guessing which part of the VTY the commands are about. Node section names, e.g. for OsmoHLR, will be like 1 VTY reference 1.4 config 1.5 config-log 1.6 config-line 1.7 config-ctrl 1.8 config-hlr 1.9 config-hlr-gsup Before this patch, all but '1 VTY reference' were plain empty. A better solution would be to list the actual command name that enters the node, and to nest the commands identically to VTY node nesting, but since this information is currently hidden in node command implementations, it is impossible to derive it. So we should actually make the VTY reflect the node nesting structure in its data model, which would resolve both the accurate node name problem as well as produce well-structured output to generate the VTY references from. This patch is a workaround for lack of a more profound fix of the VTY data model. At least it makes the VTY references' sections even remotely useful. Change-Id: Iaf745b2ab3d9b02fc47025a0eba3beb711068bfe --- src/vty/command.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/vty/command.c') diff --git a/src/vty/command.c b/src/vty/command.c index 73957115..55284eed 100644 --- a/src/vty/command.c +++ b/src/vty/command.c @@ -705,6 +705,7 @@ static int vty_dump_nodes(struct vty *vty) if (same_name_count > 1 || !*cnode->name) vty_out(vty, "_%d", same_name_count); vty_out(vty, "'>%s", VTY_NEWLINE); + vty_out(vty, " %s%s", cnode->name, VTY_NEWLINE); for (j = 0; j < vector_active(cnode->cmd_vector); ++j) { struct cmd_element *elem; -- cgit v1.2.3