projects
/
pve-common.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ec79c0
)
print_api_result_plain: new helper
author
Dietmar Maurer
<dietmar@proxmox.com>
Fri, 27 Jul 2018 13:22:30 +0000
(15:22 +0200)
committer
Thomas Lamprecht
<t.lamprecht@proxmox.com>
Mon, 30 Jul 2018 13:52:53 +0000
(15:52 +0200)
Usefull to print result without borders an headers.
Signed-off-by: Dietmar Maurer <dietmar@proxmox.com>
src/PVE/CLIFormatter.pm
patch
|
blob
|
blame
|
history
diff --git
a/src/PVE/CLIFormatter.pm
b/src/PVE/CLIFormatter.pm
index d964b51cda6343d3a75454651fba6a04eea198fe..2a2ff30b494e1b6164bf997aea0d565e366f6174 100644
(file)
--- a/
src/PVE/CLIFormatter.pm
+++ b/
src/PVE/CLIFormatter.pm
@@
-436,4
+436,16
@@
sub print_api_result {
}
}
+sub print_api_result_plain {
+ my ($data, $result_schema, $props_to_print, $options) = @_;
+
+ # avoid borders and header, ignore terminal width
+ $options = $options ? { %$options } : {}; # copy
+
+ $options->{noheader} //= 1;
+ $options->{noborder} //= 1;
+
+ print_api_result($data, $result_schema, $props_to_print, $options, {});
+}
+
1;