]> git.sur5r.net Git - ngadmin/commitdiff
Cli: align fields in switch list
authordarkcoven <admin@darkcoven.tk>
Tue, 8 Apr 2014 17:28:53 +0000 (19:28 +0200)
committerdarkcoven <admin@darkcoven.tk>
Tue, 8 Apr 2014 17:28:53 +0000 (19:28 +0200)
cli/src/common.c

index f7a0acb472eca8998b23248dd10c3c27e1ae321f..6fe12edeaffd7f5b1e2b90a4e5ecefa1c8f45b0f 100644 (file)
@@ -114,10 +114,10 @@ void displaySwitchTab (const struct swi_attr *sa, int nb)
                return;
        }
        
-       printf("Num\tMac\t\t\tProduct\t\tName\t\t\tIP\t\tPorts\tFirmware\n");
+       printf("Num\tMac\t\t\tProduct\t\t\tName\t\t\t\t\tIP\t\tPorts\tFirmware\n");
        
        for (i = 0; i < nb; i++)
-               printf("%i\t%s\t%s\t%s\t\t%s\t%i\t%s\n", i, ether_ntoa(&sa[i].mac), sa[i].product, sa[i].name, inet_ntoa(sa[i].nc.ip), sa[i].ports, sa[i].firmware);
+               printf("% 3d\t%-17s\t%-16.16s\t%-32.32s\t%-15s\t% 5d\t%s\n", i, ether_ntoa(&sa[i].mac), sa[i].product, sa[i].name, inet_ntoa(sa[i].nc.ip), sa[i].ports, sa[i].firmware);
        
        printf("\nfound %i switch(es)\n", nb);
 }