networkctl: set table width 0 when --full is specified

This commit is contained in:
Yu Watanabe
2020-01-10 12:12:00 +09:00
parent a362c069a9
commit a42d949080
2 changed files with 16 additions and 1 deletions

View File

@@ -316,7 +316,7 @@ s - Service VLAN, m - Two-port MAC Relay (TPMR)
<term><option>--full</option></term>
<listitem>
<para>Do not ellipsize the logs in <command>status</command> command.</para>
<para>Do not ellipsize the output.</para>
</listitem>
</varlistentry>

View File

@@ -518,6 +518,9 @@ static int list_links(int argc, char *argv[], void *userdata) {
if (!table)
return log_oom();
if (arg_full)
table_set_width(table, 0);
table_set_header(table, arg_legend);
assert_se(cell = table_get_cell(table, 0, 0));
@@ -840,6 +843,9 @@ static int dump_address_labels(sd_netlink *rtnl) {
if (!table)
return -ENOMEM;
if (arg_full)
table_set_width(table, 0);
r = table_set_sort(table, 0, SIZE_MAX);
if (r < 0)
return r;
@@ -1197,6 +1203,9 @@ static int link_status_one(
if (!table)
return -ENOMEM;
if (arg_full)
table_set_width(table, 0);
assert_se(cell = table_get_cell(table, 0, 0));
(void) table_set_ellipsize_percent(table, cell, 100);
@@ -1575,6 +1584,9 @@ static int system_status(sd_netlink *rtnl, sd_hwdb *hwdb) {
if (!table)
return -ENOMEM;
if (arg_full)
table_set_width(table, 0);
assert_se(cell = table_get_cell(table, 0, 0));
(void) table_set_ellipsize_percent(table, cell, 100);
@@ -1742,6 +1754,9 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
if (!table)
return -ENOMEM;
if (arg_full)
table_set_width(table, 0);
table_set_header(table, arg_legend);
assert_se(cell = table_get_cell(table, 0, 0));