add module specific help
authorChristian Garbs <mitch@cgarbs.de>
Fri, 26 Dec 2008 22:00:21 +0000 (23:00 +0100)
committerRalf Ertzinger <sun@lain.camperquake.de>
Sun, 28 Dec 2008 21:09:27 +0000 (22:09 +0100)
xmlrtorrent.pl
xmlrtorrent/Base.pm
xmlrtorrent/HTTPTalker.pm

index 4c3e520..9d5a77d 100644 (file)
@@ -323,14 +323,25 @@ sub cmd_help {
     my $target = shift;
     my $p;
 
-    write_irssi(<<'EOT');
+    if (defined($target)) {
+        foreach $p (@talkers) {
+            if ($p->{'NAME'} eq $target) {
+                write_irssi($p->gethelpstr());
+                return;
+            }
+        }
+        write_irssi('No such module');
+    } else {
+       write_irssi(<<'EOT');
 Supported commands:
  save: save the current configuration
- help: display this help or module specific help
+ help [modulename]: display this help or module specific help
  talker [modulename]: display or set the talker to use
  debug: enable debugging messages
  nodebug: disable debugging messages
 EOT
+;
+    }
 }
 
 sub cmd_talker {
index aa9e348..9ee8222 100644 (file)
@@ -142,10 +142,10 @@ sub gethelpstr {
     my $p;
 
     if (exists($self->{'DESC'})) {
-        $s .= "Description:\n " . $self->{'DESC'};
+        $s .= "Description:\n  " . $self->{'DESC'} . "\n";
     }
 
-    $s .= " Options:\n";
+    $s .= "Options:\n";
     foreach $k (keys(%{$self->{'_CONFIG'}->{'option'}})) {
         $p = $self->{'_PARAMS'}->{$k}->[0];
         $p =~ s/%/%%/g;
index 612d9fc..bab2209 100644 (file)
@@ -16,6 +16,7 @@ sub new {
     my $self = $class->SUPER::new();
 
     $self->{'NAME'} = 'http';
+    $self->{'DESC'} = 'talker using RPC over HTTP';
 
     bless($self, $class);