From: Tomasz Konojacki Date: Sun, 17 Sep 2017 04:12:37 +0000 (+0200) Subject: ls.pl: inform about lack of matches X-Git-Url: http://git.99rst.org/?a=commitdiff_plain;h=a7b6c87b80f1f7877d1d53b715743ebc271c8fd5;p=irssi-scripts.irssi.org.git ls.pl: inform about lack of matches --- diff --git a/scripts/ls.pl b/scripts/ls.pl index c07e94b..c38a3da 100644 --- a/scripts/ls.pl +++ b/scripts/ls.pl @@ -31,10 +31,18 @@ sub cmd_ls { return; } + my $found; foreach my $nick (@nicks) { my $n = $nick->{nick} . "!" . $nick->{host}; - $channel->print("$n") if $n =~ $re; + if ($n =~ $re) { + $channel->print($n); + $found = 1; + } + } + + if (not $found) { + $channel->print("No matches"); } }