ni: cleaned options context
authorAlexandre Terrasa <alexandre@moz-code.org>
Sun, 23 Jun 2013 20:07:59 +0000 (16:07 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Sun, 23 Jun 2013 20:07:59 +0000 (16:07 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/ni.nit

index 8d09f1e..76a40b6 100644 (file)
@@ -36,9 +36,10 @@ class NitIndex
        init(toolcontext: ToolContext) do
                # We need a model to collect stufs
                self.toolcontext = toolcontext
+               self.toolcontext.option_context.options.clear
                self.arguments = toolcontext.option_context.rest
 
-               if arguments.length > 2 then
+               if arguments.is_empty or arguments.length > 2 then
                        print "usage: ni path/to/module.nit [expression]"
                        toolcontext.option_context.usage
                        exit(1)