3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-02 01:18:40 +02:00

ProcessManager: show "No output." for processes that exit without output; add $context flag to suppress this

This commit is contained in:
Pragmatic Software 2020-05-04 16:51:55 -07:00
parent ba3b22d124
commit 2dfae83478
2 changed files with 12 additions and 4 deletions

View File

@ -232,7 +232,8 @@ sub process_pipe_reader {
if (not defined $context->{result} or not length $context->{result}) { if (not defined $context->{result} or not length $context->{result}) {
$self->{pbot}->{logger}->log("No result from process.\n"); $self->{pbot}->{logger}->log("No result from process.\n");
return; return if $context->{suppress_no_output};
$context->{result} = "No output.";
} }
if ($context->{referenced}) { return if $context->{result} =~ m/(?:no results)/i; } if ($context->{referenced}) { return if $context->{result} =~ m/(?:no results)/i; }

View File

@ -65,9 +65,16 @@ sub show_url_titles {
} }
my $context = { my $context = {
from => $channel, nick => $nick, user => $user, host => $host, from => $channel,
command => "title $nick $url", root_channel => $channel, root_keyword => "title", nick => $nick,
keyword => "title", arguments => "$nick $url" user => $user,
host => $host,
command => "title $nick $url",
root_channel => $channel,
root_keyword => "title",
keyword => "title",
arguments => "$nick $url",
suppress_no_output => 1,
}; };
$self->{pbot}->{modules}->execute_module($context); $self->{pbot}->{modules}->execute_module($context);