nitg: protect for additional arguments
authorJean Privat <jean@pryen.org>
Fri, 14 Dec 2012 04:38:42 +0000 (23:38 -0500)
committerJean Privat <jean@pryen.org>
Fri, 14 Dec 2012 04:38:42 +0000 (23:38 -0500)
Signed-off-by: Jean Privat <jean@pryen.org>

src/nitg.nit

index 24b7a3f..fbb09c2 100644 (file)
@@ -39,6 +39,11 @@ if arguments.is_empty then
        toolcontext.option_context.usage
        return
 end
+if arguments.length > 1 then
+       print "Too much arguments: {arguments.join(" ")}"
+       toolcontext.option_context.usage
+       return
+end
 var progname = arguments.first
 
 # Here we load an process all modules passed on the command line