From 0afaf9eb1b9da50fb5869d12ff8a6389d176ce26 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 17 Jan 2015 04:39:19 -0800 Subject: [PATCH] Show usage if no code given --- modules/compiler_vm/compiler_vm_client.pl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/compiler_vm/compiler_vm_client.pl b/modules/compiler_vm/compiler_vm_client.pl index e657cc85..79a0ec70 100755 --- a/modules/compiler_vm/compiler_vm_client.pl +++ b/modules/compiler_vm/compiler_vm_client.pl @@ -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=] [-info] [language options] [-input=]\n"; + exit; +} + my $lang = $language->new(nick => $nick, channel => $channel, lang => $language, code => $code); $lang->process_interactive_edit;