Having it to access directly `sys.args` broke some isolation concerns.
This commit also updates all tools to avoid breakage.
Signed-off-by: Jean Privat <jean@pryen.org>
var opt_mixins = new OptionArray("Additionals module to min-in", "-m")
toolcontext.option_context.add_option(opt_mixins)
# We do not add other options, so process them now!
- toolcontext.process_options
+ toolcontext.process_options(args)
# We need a model to collect stufs
var model = new Model
self.option_context.add_option(opt_nocolors)
end
- redef fun process_options
+ redef fun process_options(args)
do
super
var val = self.opt_dir.value
var toolcontext = new ToolContext
toolcontext.tooldescription = "Usage: nitdbg_client [OPTION]...\nConnects to a nitdbg_server and controls it."
toolcontext.accept_no_arguments = true
-toolcontext.process_options
+toolcontext.process_options(args)
var debug: DebugClient
toolcontext.option_context.add_option(opt_piwik_tracker)
toolcontext.option_context.add_option(opt_piwik_site_id)
toolcontext.tooldescription = "Usage: nitdoc [OPTION]... <file.nit>...\nGenerates HTML pages of API documentation from Nit source files."
- toolcontext.process_options
+ toolcontext.process_options(args)
self.arguments = toolcontext.option_context.rest
self.process_options
toolcontext.tooldescription = "Usage: nitg [OPTION]... file.nit\nCompiles Nit programs."
# We do not add other options, so process them now!
-toolcontext.process_options
+toolcontext.process_options(args)
# We need a model to collect stufs
var model = new Model
var model = new Model
var modelbuilder = new ModelBuilder(model, toolcontext)
-toolcontext.process_options
+toolcontext.process_options(args)
var args = toolcontext.option_context.rest
var mmodules = modelbuilder.parse(args)
tc.option_context.add_option(opt_keep, opt_recursive, opt_tree, opt_source, opt_project, opt_depends)
tc.tooldescription = "Usage: nitls [OPTION]... <file.nit|directory>...\nLists the projects and/or paths of Nit sources files."
-tc.process_options
+tc.process_options(args)
var sum = opt_tree.value.to_i + opt_source.value.to_i + opt_project.value.to_i + opt_depends.value.to_i
if sum > 1 then
toolcontext.tooldescription = "Usage: nitmetrics [OPTION]... <file.nit>...\mComputes various metrics on Nit programs."
# We do not add other options, so process them now!
-toolcontext.process_options
+toolcontext.process_options(args)
# Get arguments
var arguments = toolcontext.option_context.rest
toolcontext.option_context.add_option(toolcontext.opt_full, toolcontext.opt_output, toolcontext.opt_dir)
toolcontext.tooldescription = "Usage: nitunit [OPTION]... <file.nit>...\nExecutes the unit tests from Nit source files."
-toolcontext.process_options
+toolcontext.process_options(args)
var args = toolcontext.option_context.rest
var model = new Model
# Create a tool context to handle options and paths
var toolcontext = new ToolContext
toolcontext.tooldescription = "Usage: nitx [OPTION]... <file.nit> [query]\nDisplays specific pieces of API information from Nit source files."
-toolcontext.process_options
+toolcontext.process_options(args)
# Here we launch the nit index
var ni = new NitIndex(toolcontext)
toolcontext.option_context.add_option(opt_full)
toolcontext.tooldescription = "Usage: test_markdown [OPTION]... <file.nit>...\nGenerates HTML of comments of documentation from Nit source files."
-toolcontext.process_options
+toolcontext.process_options(args)
var args = toolcontext.option_context.rest
var model = new Model
toolcontext.tooldescription = "Usage: [OPTION]... <file.nit>..."
# We do not add other options, so process them now!
-toolcontext.process_options
+toolcontext.process_options(args)
# Get arguments
var arguments = toolcontext.option_context.rest
end
# Parse and process the options given on the command line
- fun process_options
+ fun process_options(args: Sequence[String])
do
self.opt_warn.value = 1