File: scripthelp.pl

package info (click to toggle)
irssi-scripts 20100512
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 3,420 kB
  • ctags: 2,479
  • sloc: perl: 58,204; sh: 171; makefile: 33
file content (37 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use Irssi;

use vars qw($VERSION %IRSSI %HELP);
$VERSION = "0.9";
%IRSSI = (
	authors         => "Maciek \'fahren\' Freudenheim",
	contact         => "fahren\@bochnia.pl",
	name            => "Scripts help",
	description     => "Provides access to script\'s help",
	license         => "GNU GPLv2 or later",
	changed         => "Sat Apr 13 02:23:37 CEST 2002"
);
$HELP{scripthelp} = "
Provides help for irssi's perl scripts.

All what you have to do is to add
\$HELP{commandname} = \"
    your help goes here
\";
to your script.
";

sub cmd_help {
	my ($args, $server, $win) = @_;

	# from scriptinfo.pl
	for (sort grep s/::$//, keys %Irssi::Script::) {
		my $help = ${ "Irssi::Script::${_}::HELP" }{$args};
		if ($help) {
			Irssi::signal_stop();
			Irssi::print("$help");
			return;
		}
	}		
}

Irssi::command_bind("help", "cmd_help");