2015-01-15 06:51:17 +01:00
|
|
|
#!/usr/bin/env perl
|
2011-01-26 02:59:19 +01:00
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
use warnings;
|
2011-01-26 02:59:19 +01:00
|
|
|
use strict;
|
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
my $language = shift @ARGV // 'c11';
|
|
|
|
$language = lc $language;
|
2014-07-04 15:04:27 +02:00
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
eval {
|
|
|
|
use lib 'languages';
|
|
|
|
require "$language.pm";
|
|
|
|
} or do {
|
|
|
|
print "Language '$language' is not supported.\n";
|
|
|
|
die $@;
|
2012-09-01 07:20:01 +02:00
|
|
|
};
|
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
my $nick = shift @ARGV // (print "Missing nick argument.\n" and die);
|
|
|
|
my $channel = shift @ARGV // (print "Missing channel argument.\n" and die);
|
|
|
|
my $code = join(' ', @ARGV);
|
2014-04-03 01:48:43 +02:00
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
my $lang = $language->new(nick => $nick, channel => $channel, lang => $language, code => $code);
|
2014-04-03 01:48:43 +02:00
|
|
|
|
2015-01-15 06:51:17 +01:00
|
|
|
$lang->process_interactive_edit;
|
|
|
|
$lang->process_standard_options;
|
|
|
|
$lang->process_custom_options;
|
|
|
|
$lang->process_cmdline_options;
|
|
|
|
$lang->preprocess_code;
|
|
|
|
$lang->execute;
|
|
|
|
$lang->postprocess_output;
|
|
|
|
$lang->show_output;
|