From f909d336c3fe620caca1f9aa2ccb98c4b2d0f271 Mon Sep 17 00:00:00 2001 From: Vadim Yanitskiy Date: Mon, 21 Sep 2020 23:30:14 +0700 Subject: vty: cosmetic: s/width/cmd_width/g in vty_describe_command() Change-Id: Ifcf5f7be925c5421040d3cac2c4c5e4dd497c0f5 --- src/vty/vty.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/vty/vty.c b/src/vty/vty.c index e335f3a7..2b131a4e 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1119,7 +1119,7 @@ static void vty_describe_command(struct vty *vty) int ret; vector vline; vector describe; - unsigned int i, width, desc_width; + unsigned int i, cmd_width, desc_width; struct desc *desc, *desc_cr = NULL; vline = cmd_make_strvec(vty->buf); @@ -1152,7 +1152,7 @@ static void vty_describe_command(struct vty *vty) } /* Get width of command string. */ - width = 0; + cmd_width = 0; for (i = 0; i < vector_active(describe); i++) if ((desc = vector_slot(describe, i)) != NULL) { unsigned int len; @@ -1164,12 +1164,12 @@ static void vty_describe_command(struct vty *vty) if (desc->cmd[0] == '.') len--; - if (width < len) - width = len; + if (cmd_width < len) + cmd_width = len; } /* Get width of description string. */ - desc_width = vty->width - (width + 6); + desc_width = vty->width - (cmd_width + 6); /* Print out description. */ for (i = 0; i < vector_active(describe); i++) @@ -1188,15 +1188,15 @@ static void vty_describe_command(struct vty *vty) '.' ? desc->cmd + 1 : desc->cmd, VTY_NEWLINE); else if (desc_width >= strlen(desc->str)) - vty_out(vty, " %-*s %s%s", width, + vty_out(vty, " %-*s %s%s", cmd_width, desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, desc->str, VTY_NEWLINE); else - vty_describe_fold(vty, width, desc_width, desc); + vty_describe_fold(vty, cmd_width, desc_width, desc); #if 0 - vty_out(vty, " %-*s %s%s", width + vty_out(vty, " %-*s %s%s", cmd_width desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, desc->str ? desc->str : "", VTY_NEWLINE); #endif /* 0 */ @@ -1208,11 +1208,11 @@ static void vty_describe_command(struct vty *vty) desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, VTY_NEWLINE); else if (desc_width >= strlen(desc->str)) - vty_out(vty, " %-*s %s%s", width, + vty_out(vty, " %-*s %s%s", cmd_width, desc->cmd[0] == '.' ? desc->cmd + 1 : desc->cmd, desc->str, VTY_NEWLINE); else - vty_describe_fold(vty, width, desc_width, desc); + vty_describe_fold(vty, cmd_width, desc_width, desc); } cmd_free_strvec(vline); -- cgit v1.2.3