3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 03:33:06 +01:00

Correct handling of no-output

This commit is contained in:
Pragmatic Software 2015-01-16 17:28:38 -08:00
parent 16dce2c484
commit 925f2292e0

View File

@ -134,9 +134,10 @@ sub interpret {
$mod->postprocess if not $mod->{error};
if (not length $mod->{output}) {
$mod->{output} = "Success (no output).\n" if not $mod->{error};
$mod->{output} = "Success (exit code $mod->{error}).\n" if $mod->{error};
if (exists $mod->{no_output} or not length $mod->{output}) {
$mod->{output} .= "\n" if length $mod->{output};
$mod->{output} .= "Success (no output).\n" if not $mod->{error};
$mod->{output} .= "Success (exit code $mod->{error}).\n" if $mod->{error};
}
return $mod->{output};