From: Jameson Rollins Date: Sun, 26 Dec 2010 01:56:17 +0000 (-0500) Subject: msva-query-agent only append newline to msg output if tty X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a328802a;p=monkeysphere-validation-agent.git msva-query-agent only append newline to msg output if tty msva-query-agent will now only append a newline to the msva return message on stdout if there is a TTY. This allows calling processes that would like to capture the stdout to not have to deal with the newline, which is not actually a part of the original message anyway. --- diff --git a/msva-query-agent b/msva-query-agent index e4e0a68..63f9e85 100755 --- a/msva-query-agent +++ b/msva-query-agent @@ -51,7 +51,8 @@ $client->log('info', "status: %s\n", $status); if (defined $ret) { $client->log('info', "valid: %s\n", $ret->{valid}); $client->log('info', "server: %s\n", $ret->{server}); - printf("%s\n", $ret->{message}); + printf("%s", $ret->{message}); + printf("\n") if (-t STDOUT); exit 0 if ($ret->{valid}); }