From: Christian Garbs Date: Fri, 26 Dec 2008 22:00:21 +0000 (+0100) Subject: add module specific help X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=xmlrtorrent.git;a=commitdiff_plain;h=f53811070671adc7647202740c5921bc6ae8340d add module specific help --- diff --git a/xmlrtorrent.pl b/xmlrtorrent.pl index 4c3e520..9d5a77d 100644 --- a/xmlrtorrent.pl +++ b/xmlrtorrent.pl @@ -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 { diff --git a/xmlrtorrent/Base.pm b/xmlrtorrent/Base.pm index aa9e348..9ee8222 100644 --- a/xmlrtorrent/Base.pm +++ b/xmlrtorrent/Base.pm @@ -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; diff --git a/xmlrtorrent/HTTPTalker.pm b/xmlrtorrent/HTTPTalker.pm index 612d9fc..bab2209 100644 --- a/xmlrtorrent/HTTPTalker.pm +++ b/xmlrtorrent/HTTPTalker.pm @@ -16,6 +16,7 @@ sub new { my $self = $class->SUPER::new(); $self->{'NAME'} = 'http'; + $self->{'DESC'} = 'talker using RPC over HTTP'; bless($self, $class);