If $noprint is set, the output of the command won't be printed to stdout
of the parent process.
Fully backwards-compatible again, only takes effect if the new argument
is actually specified.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
# to exit early and ignore the rest of the process output.
# * $input - Stdin contents for the spawned subprocess
# * $noout - Whether to append any process output to the return value
+# * $noprint - Whether to print any process output to the parents stdout
sub run_command {
- my ($cmd, $func, $input, $noout) = @_;
+ my ($cmd, $func, $input, $noout, $noprint) = @_;
my $cmdstr;
if (!ref($cmd)) {
} elsif ($h eq $error) {
$ostream .= $buf if !($noout || $func);
}
- print $buf;
+ print $buf if !$noprint;
STDOUT->flush();
log_info($buf);
}