]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
ls.pl: inform about lack of matches
authorTomasz Konojacki <redacted>
Sun, 17 Sep 2017 04:12:37 +0000 (06:12 +0200)
committerTomasz Konojacki <redacted>
Sun, 17 Sep 2017 04:22:35 +0000 (06:22 +0200)
scripts/ls.pl

index c07e94be34d0d8299084e04a97fd2b660e106781..c38a3da31355feab293912e9d7872e022da286e3 100644 (file)
@@ -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");
        }
 }
 
git clone https://git.99rst.org/PROJECT