Nest: Minor formatting changes

This commit is contained in:
Ondrej Zajicek (work) 2017-12-08 15:16:47 +01:00
parent 49c7ef3b21
commit eb95b5ec1a
3 changed files with 13 additions and 8 deletions

View file

@ -1662,13 +1662,14 @@ proto_cmd_show(struct proto *p, uintptr_t verbose, int cnt)
/* First protocol - show header */ /* First protocol - show header */
if (!cnt) if (!cnt)
cli_msg(-2002, "name proto table state since info"); cli_msg(-2002, "%-10s %-10s %-10s %-6s %-12s %s",
"Name", "Proto", "Table", "State", "Since", "Info");
buf[0] = 0; buf[0] = 0;
if (p->proto->get_status) if (p->proto->get_status)
p->proto->get_status(p, buf); p->proto->get_status(p, buf);
tm_format_time(tbuf, &config->tf_proto, p->last_state_change); tm_format_time(tbuf, &config->tf_proto, p->last_state_change);
cli_msg(-1002, "%-8s %-8s %-8s %-5s %-10s %s", cli_msg(-1002, "%-10s %-10s %-10s %-6s %-12s %s",
p->name, p->name,
p->proto->name, p->proto->name,
p->main_channel ? p->main_channel->table->name : "---", p->main_channel ? p->main_channel->table->name : "---",

View file

@ -63,7 +63,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
if (d->last_table != d->tab) if (d->last_table != d->tab)
rt_show_table(c, d); rt_show_table(c, d);
cli_printf(c, -1007, "%-18s %s [%s %s%s]%s%s", ia, rta_dest_name(a->dest), cli_printf(c, -1007, "%-20s %s [%s %s%s]%s%s", ia, rta_dest_name(a->dest),
a->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info); a->src->proto->name, tm, from, primary ? (sync_error ? " !" : " *") : "", info);
if (a->dest == RTD_UNICAST) if (a->dest == RTD_UNICAST)
@ -71,6 +71,7 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
{ {
char mpls[MPLS_MAX_LABEL_STACK*12 + 5], *lsp = mpls; char mpls[MPLS_MAX_LABEL_STACK*12 + 5], *lsp = mpls;
char *onlink = (nh->flags & RNF_ONLINK) ? " onlink" : ""; char *onlink = (nh->flags & RNF_ONLINK) ? " onlink" : "";
char weight[16] = "";
if (nh->labels) if (nh->labels)
{ {
@ -81,11 +82,14 @@ rt_show_rte(struct cli *c, byte *ia, rte *e, struct rt_show_data *d, ea_list *tm
*lsp = '\0'; *lsp = '\0';
if (a->nh.next) if (a->nh.next)
cli_printf(c, -1007, "\tvia %I%s on %s%s weight %d", bsprintf(weight, " weight %d", nh->weight + 1);
nh->gw, mpls, nh->iface->name, onlink, nh->weight + 1);
if (ipa_nonzero(nh->gw))
cli_printf(c, -1007, "\tvia %I on %s%s%s%s",
nh->gw, nh->iface->name, mpls, onlink, weight);
else else
cli_printf(c, -1007, "\tvia %I%s on %s%s", cli_printf(c, -1007, "\tdev %s%s%s",
nh->gw, mpls, nh->iface->name, onlink); nh->iface->name, mpls, onlink, weight);
} }
if (d->verbose) if (d->verbose)