diff options
| author | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
|---|---|---|
| committer | Alexander Færøy | 2014-05-31 13:10:46 +0200 | 
| commit | 2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1 (patch) | |
| tree | 1c5e6d817c88e67b46e216a50e0aef5428bf63df /scripts/scripthelp.pl | |
| parent | 2d080422d79d1fd49d6c5528593ccaaff9bfc583 (diff) | |
| download | scripts.irssi.org-2d0759e6ca5767b48bcc85bf38c2c43d5f0b63b1.tar.bz2 | |
Import scripts from scripts.irssi.org
Diffstat (limited to 'scripts/scripthelp.pl')
| -rw-r--r-- | scripts/scripthelp.pl | 37 | 
1 files changed, 37 insertions, 0 deletions
| diff --git a/scripts/scripthelp.pl b/scripts/scripthelp.pl new file mode 100644 index 0000000..316aeb2 --- /dev/null +++ b/scripts/scripthelp.pl @@ -0,0 +1,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"); | 
