mirror of
https://github.com/libvirt/libvirt.git
synced 2026-09-03 20:53:04 -05:00
virsh: Implement new table API for virsh list
Instead of printing it straight in virsh, it creates table struct which is filled with header and rows(domains). It allows us to know more about table before printing to calculate alignment right. Signed-off-by: Simon Kobyda <skobyda@redhat.com>
This commit is contained in:
committed by
Michal Privoznik
parent
9417f0b3f6
commit
2e97450425
+7
-7
@@ -98,9 +98,9 @@ static int testCompareListDefault(const void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
const char *const argv[] = { VIRSH_DEFAULT, "list", NULL };
|
||||
const char *exp = "\
|
||||
Id Name State\n\
|
||||
----------------------------------------------------\n\
|
||||
1 test running\n\
|
||||
Id Name State \n\
|
||||
----------------------\n\
|
||||
1 test running \n\
|
||||
\n";
|
||||
return testCompareOutputLit(exp, NULL, argv);
|
||||
}
|
||||
@@ -109,10 +109,10 @@ static int testCompareListCustom(const void *data ATTRIBUTE_UNUSED)
|
||||
{
|
||||
const char *const argv[] = { VIRSH_CUSTOM, "list", NULL };
|
||||
const char *exp = "\
|
||||
Id Name State\n\
|
||||
----------------------------------------------------\n\
|
||||
1 fv0 running\n\
|
||||
2 fc4 running\n\
|
||||
Id Name State \n\
|
||||
----------------------\n\
|
||||
1 fv0 running \n\
|
||||
2 fc4 running \n\
|
||||
\n";
|
||||
return testCompareOutputLit(exp, NULL, argv);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user