aboutsummaryrefslogtreecommitdiffstats
path: root/feature-tests/easy_exec.pl
blob: dbcd101f64ddeacb3cbaef54c107e58ba13f5fe2 (plain) (blame)
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
use strict;
use warnings;

# export everything.
use Irssi (@Irssi::EXPORT_OK);
use Irssi::Irc;
use Irssi::TextUI;

use Data::Dumper;

our $VERSION = '0.1';
our %IRSSI = (
              authors     => 'shabble',
              contact     => 'shabble+irssi@metavore.org',
              name        => 'easy_exec',
              description => 'drop-in replacement for /script exec which imports'
               . ' all of the Irssi:: namespace for easier testing',
              license     => 'Public Domain',
             );

Irssi::signal_add_first 'command script exec', \&better_exec;

sub better_exec {
    my ($args, $serv, $witem) = @_;
    eval $args;
    Irssi::signal_stop();
}

sub Dump {
    print Dumper(\@_);
}

sub test() {
    print "This is a test";
}