add show command
authorChristian Garbs <mitch@cgarbs.de>
Fri, 26 Dec 2008 23:45:54 +0000 (00:45 +0100)
committerChristian Garbs <mitch@cgarbs.de>
Fri, 26 Dec 2008 23:45:54 +0000 (00:45 +0100)
xmlrtorrent.pl

index 12367cb..3e13500 100644 (file)
@@ -308,6 +308,21 @@ sub cmd_show {
     my $target = shift;
     my $p;
     my $e;
+
+    if (defined($target)) {
+        foreach $p (@talkers) {
+            if ($p->{'NAME'} eq $target) {
+                write_irssi($p->getconfstr());
+                return;
+            }
+        }
+        write_irssi('No such module');
+    } else {
+        write_irssi('Loaded talkers:');
+        foreach $p (@talkers) {
+            write_irssi(' %s', $p->{'NAME'});
+        };
+    }
 }
 
 sub cmd_help {
@@ -327,6 +342,7 @@ sub cmd_help {
 Supported commands:
  save: save the current configuration
  help [modulename]: display this help or module specific help
+ show [modulename]: show loaded modules or the current parameters of a module
  talker [modulename]: display or set the talker to use
  debug: enable debugging messages
  nodebug: disable debugging messages