3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01: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}) {
$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; }

View File

@ -65,9 +65,16 @@ sub show_url_titles {
}
my $context = {
from => $channel, nick => $nick, user => $user, host => $host,
command => "title $nick $url", root_channel => $channel, root_keyword => "title",
keyword => "title", arguments => "$nick $url"
from => $channel,
nick => $nick,
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);