]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
[elist] Add optional -yes/-YES option
authorJon Pavelich <redacted>
Thu, 9 May 2019 17:19:12 +0000 (10:19 -0700)
committerJon Pavelich <redacted>
Thu, 9 May 2019 17:19:12 +0000 (10:19 -0700)
scripts/elist.pl

index 104c108dc315e9a0d60c5c3504247f5cc7dc1b43..b11da2cde6ee76a6abb5e80f1f79062050330d27 100644 (file)
@@ -42,6 +42,7 @@ sub elist_config_init {
   %elist_config = (
     mincount => 0,
     maxcount => 10000,
+    yes => "",
     chanmask => ""
   );
 }
@@ -59,6 +60,7 @@ sub elist {
   GetOptions (
     'mincount|m=i' => \$elist_config{"mincount"},
     'maxcount|M=i' => \$elist_config{"maxcount"},
+    'yes|YES' => \$elist_config{"yes"}
   );
  
   ## setting chanmask (remaining argument) ##
@@ -77,7 +79,7 @@ sub elist {
   print "%K[%n".$server->{'tag'}."%K]%n %B<-->%n %m"."elist %n%B(%y"."min=%m".$elist_config{"mincount"}."%n".
                                                      ", %y"."max=%m".$elist_config{"maxcount"}."%n".
                                                      ", %y"."mask=%K'%m".$elist_config{"chanmask"}."%K'%B)";
-  $server->command("LIST " . $elist_config{"chanmask"});
+  $server->command("LIST " . ($elist_config{"yes"} ? "-YES " : "") . $elist_config{"chanmask"});
 }
 
 
git clone https://git.99rst.org/PROJECT