Morten Brix Pedersen 24 лет назад
Родитель
Сommit
0c9b9fbf12
3 измененных файлов с 19 добавлено и 1 удалено
  1. 3 0
      docs/Changelog
  2. 13 1
      modules/Pisg.pm
  3. 3 0
      pisg

+ 3 - 0
docs/Changelog

@@ -20,6 +20,9 @@ pisg (x.xx)
      Hanno Hecker <hanno-pisg@bee.de>)
      Hanno Hecker <hanno-pisg@bee.de>)
    * A problem with multiple mode changes (+vv, +oo) in Trillian format has
    * A problem with multiple mode changes (+vv, +oo) in Trillian format has
      been fixed.
      been fixed.
+   * --cchannels commandline option added, when a channel is specified here,
+     it will be the only channel to run stats for in pisg.cfg. (thanks,
+     "Matthew \"Cheetah\" Gabeler-Lee" <msg2@po.cwru.edu>)
 
 
 pisg (0.38) - Thu Apr, 25th 2002
 pisg (0.38) - Thu Apr, 25th 2002
    * Grammar fixes in documentation (thanks, Azhrarn <diablo2@krock.com>)
    * Grammar fixes in documentation (thanks, Azhrarn <diablo2@krock.com>)

+ 13 - 1
modules/Pisg.pm

@@ -494,8 +494,20 @@ sub parse_channels
 {
 {
     my $self = shift;
     my $self = shift;
     my %origcfg = %{ $self->{cfg} };
     my %origcfg = %{ $self->{cfg} };
+    
+    # make a list of channels to do
+    my @chanlist;
+    if (defined $self->{cfg}->{cchannels}) {
+        @chanlist = @{ $self->{cfg}->{cchannels} };
+    } else {
+        @chanlist = keys %{ $self->{chans} };
+    }
 
 
-    foreach my $channel (keys %{ $self->{chans} }) {
+    foreach my $channel (@chanlist) {
+        if (!defined $self->{chans}->{$channel}) {
+            print STDERR "Channel $channel not in config file, ignoring\n";
+            next;
+        }
         foreach (keys %{ $self->{chans}->{$channel} }) {
         foreach (keys %{ $self->{chans}->{$channel} }) {
             $self->{cfg}->{$_} = $self->{chans}->{$channel}{$_};
             $self->{cfg}->{$_} = $self->{chans}->{$channel}{$_};
         }
         }

+ 3 - 0
pisg

@@ -82,6 +82,8 @@ Usage: pisg [-ch channel] [-l logfile] [-o outputfile] [-ma maintainer]
 [-f format] [-n network] [-d logdir] [-mo moduledir] [-s] [-v] [-h]
 [-f format] [-n network] [-d logdir] [-mo moduledir] [-s] [-v] [-h]
 
 
 -ch --channel=xxx      : Set channel name
 -ch --channel=xxx      : Set channel name
+-cc --cchannels=xxx    : Only do this channel from cfg file, give multiple
+                         times to do multiple channels
 -l  --logfile=xxx      : Log file to parse
 -l  --logfile=xxx      : Log file to parse
 -o  --outfile=xxx      : Name of HTML file to create
 -o  --outfile=xxx      : Name of HTML file to create
 -ma --maintainer=xxx   : Channel/statistics maintainer
 -ma --maintainer=xxx   : Channel/statistics maintainer
@@ -106,6 +108,7 @@ calling pisg without arguments.
 END_USAGE
 END_USAGE
 
 
     if (GetOptions('channel=s'    => \$cfg{channel},
     if (GetOptions('channel=s'    => \$cfg{channel},
+                   'cchannels=s@'  => \@{ $cfg{cchannels} },
                    'logfile=s'    => \$cfg{logfile},
                    'logfile=s'    => \$cfg{logfile},
                    'format=s'     => \$cfg{format},
                    'format=s'     => \$cfg{format},
                    'network=s'    => \$cfg{network},
                    'network=s'    => \$cfg{network},