diff options
author | David Lamparter <equinox@opensourcerouting.org> | 2017-07-14 13:15:55 +0200 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2017-07-14 13:15:55 +0200 |
commit | 84a98309def99b23c86de42ea8228d9191b65772 (patch) | |
tree | d473c3ae0dd06c865fbb318aef71e19ae96931c6 /vtysh | |
parent | *: remove vty_outln again (diff) | |
parent | Merge pull request #799 from dwalton76/bgpd-show-labeled-unicast (diff) | |
download | frr-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.c | 17 |
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); } } |