From: Peter Krempa Date: Mon, 1 Aug 2016 04:13:39 +0000 (+0200) Subject: virsh: qemu-monitor-command: Don't print extra newline with --pretty X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=8dbc95cbd18a5abab8f313b1ea9da7b3d7faaa32;p=libvirt.git virsh: qemu-monitor-command: Don't print extra newline with --pretty The prettified JSON string already contains a newline so don't print another one. This allows to pipe the json output (in conjunction with the --quiet option) to files without having to truncate them afterwards. --- diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 9c496b90dd..fc77f162f0 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -8972,6 +8972,7 @@ cmdQemuMonitorCommand(vshControl *ctl, const vshCmd *cmd) if (pretty && (tmp = virJSONValueToString(pretty, true))) { VIR_FREE(result); result = tmp; + virTrimSpaces(result, NULL); } else { vshResetLibvirtError(); }