summaryrefslogtreecommitdiffstats
path: root/vtysh
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-07-14 13:15:55 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-07-14 13:15:55 +0200
commit84a98309def99b23c86de42ea8228d9191b65772 (patch)
treed473c3ae0dd06c865fbb318aef71e19ae96931c6 /vtysh
parent*: remove vty_outln again (diff)
parentMerge pull request #799 from dwalton76/bgpd-show-labeled-unicast (diff)
downloadfrr-84a98309def99b23c86de42ea8228d9191b65772.tar.xz
frr-84a98309def99b23c86de42ea8228d9191b65772.zip
Merge remote-tracking branch 'frr/master' into newline-redux
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'vtysh')
-rw-r--r--vtysh/vtysh.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c
index 958ef3b82..5f89afdd0 100644
--- a/vtysh/vtysh.c
+++ b/vtysh/vtysh.c
@@ -776,7 +776,7 @@ vtysh_rl_describe (void)
rl_on_new_line ();
return 0;
break;
- }
+ }
/* Get width of command string. */
width = 0;
@@ -813,15 +813,14 @@ vtysh_rl_describe (void)
if (vector_active (varcomps) > 0)
{
- fprintf(stdout, " ");
- for (size_t j = 0; j < vector_active (varcomps); j++)
- {
- char *item = vector_slot (varcomps, j);
- fprintf (stdout, " %s", item);
- XFREE (MTYPE_COMPLETION, item);
- }
- vty_out (vty, "\n");
+ int rows, cols;
+ rl_get_screen_size(&rows, &cols);
+
+ char *ac = cmd_variable_comp2str(varcomps, cols, "\n");
+ fprintf(stdout, "%s\n", ac);
+ XFREE(MTYPE_TMP, ac);
}
+
vector_free (varcomps);
}
}