3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-24 03:33:06 +01:00

Show usage if no code given

This commit is contained in:
Pragmatic Software 2015-01-17 04:39:19 -08:00
parent c4c325085a
commit 0afaf9eb1b

View File

@ -33,6 +33,11 @@ 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);
if (not length $code) {
print "$nick: Usage: cc [-paste] [-nomain] [-lang=<language>] [-info] [language options] <code> [-input=<stdin input>]\n";
exit;
}
my $lang = $language->new(nick => $nick, channel => $channel, lang => $language, code => $code);
$lang->process_interactive_edit;