mirror of
https://git.kernel.org/pub/scm/network/wireless/iwd.git
synced 2024-12-23 22:42:37 +01:00
client: display table header for the empty lists
This commit is contained in:
parent
fd4ab5d3df
commit
e42aee89b1
@ -248,13 +248,13 @@ static void ordered_networks_display(struct l_queue *ordered_networks)
|
||||
const struct l_queue_entry *entry;
|
||||
bool is_first;
|
||||
|
||||
if (l_queue_length(ordered_networks)) {
|
||||
display_table_header("Available networks",
|
||||
"%s%-*s%-*s%-*s%*s", MARGIN, 2, "",
|
||||
32, "Network name", 10, "Security",
|
||||
4, "dbms");
|
||||
} else {
|
||||
display_table_header("Available networks", "%s%-*s%-*s%-*s%*s",
|
||||
MARGIN, 2, "", 32, "Network name",
|
||||
10, "Security", 4, "dbms");
|
||||
|
||||
if (!l_queue_length(ordered_networks)) {
|
||||
display("No networks available\n");
|
||||
display_table_footer();
|
||||
|
||||
return;
|
||||
}
|
||||
|
@ -78,12 +78,11 @@ static void known_networks_display(struct l_queue *known_networks)
|
||||
{
|
||||
const struct l_queue_entry *entry;
|
||||
|
||||
if (l_queue_length(known_networks))
|
||||
display_table_header("Known Networks",
|
||||
" %-*s%-*s%-*s%-*s",
|
||||
display_table_header("Known Networks", " %-*s%-*s%-*s%-*s",
|
||||
32, "Name", 11, "Security",
|
||||
19, "Last connected", 17, "Last seen");
|
||||
else
|
||||
|
||||
if (!l_queue_length(known_networks))
|
||||
display(MARGIN "No known networks\n");
|
||||
|
||||
for (entry = l_queue_get_entries(known_networks); entry;
|
||||
|
@ -146,11 +146,11 @@ static enum cmd_status cmd_list(const char *device_name, char *args)
|
||||
proxy_interface_find_all(IWD_WSC_INTERFACE,
|
||||
match_by_device, NULL);
|
||||
|
||||
if (match) {
|
||||
display_table_header("WSC-capable Devices",
|
||||
MARGIN "%-*s", 20, "Name");
|
||||
} else {
|
||||
display_table_header("WSC-capable Devices", MARGIN "%-*s", 20, "Name");
|
||||
|
||||
if (!match) {
|
||||
display("No WSC-capable devices available\n");
|
||||
display_table_footer();
|
||||
|
||||
return CMD_STATUS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user