typing: add `ARangeExpr::init_callsite` and use it everywhere
[nit.git] / src / nitx.nit
index a57af8b..d70c9e3 100644 (file)
@@ -45,12 +45,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.is_empty or arguments.length > 2 then
-                       print "usage: ni path/to/module.nit [expression]"
-                       toolcontext.option_context.usage
+               if arguments.length > 2 then
+                       print toolcontext.tooldescription
                        exit(1)
                end
 
@@ -869,7 +867,8 @@ end
 
 # Create a tool context to handle options and paths
 var toolcontext = new ToolContext
-toolcontext.process_options
+toolcontext.tooldescription = "Usage: nitx [OPTION]... <file.nit> [query]\nDisplays specific pieces of API information from Nit source files."
+toolcontext.process_options(args)
 
 # Here we launch the nit index
 var ni = new NitIndex(toolcontext)