X-Git-Url: http://nitlanguage.org diff --git a/src/nitpretty.nit b/src/nitpretty.nit index 71313c8..17cc649 100644 --- a/src/nitpretty.nit +++ b/src/nitpretty.nit @@ -35,6 +35,9 @@ redef class ToolContext # --line-width var opt_line_width = new OptionInt("Maximum length of lines (use 0 to disable automatic line breaks)", 80, "--line-width") + # --no-inline + var opt_no_inline = new OptionBool("Disable automatic one-liners", "--no-inline") + # Break too long string literals. var opt_break_str = new OptionBool("Break too long string literals", "--break-strings") @@ -73,6 +76,7 @@ var opts = toolcontext.option_context opts.add_option(toolcontext.opt_dir, toolcontext.opt_output) opts.add_option(toolcontext.opt_diff, toolcontext.opt_meld, toolcontext.opt_check) opts.add_option(toolcontext.opt_line_width, toolcontext.opt_break_str, toolcontext.opt_inline_do) +opts.add_option(toolcontext.opt_no_inline) opts.add_option(toolcontext.opt_skip_empty) toolcontext.tooldescription = "Usage: nitpretty [OPTION]... \n" + @@ -83,7 +87,7 @@ var arguments = toolcontext.option_context.rest # build model var model = new Model var mbuilder = new ModelBuilder(model, toolcontext) -var mmodules = mbuilder.parse(arguments) +var mmodules = mbuilder.parse_full(arguments) mbuilder.run_phases if mmodules.is_empty then @@ -110,6 +114,9 @@ end if toolcontext.opt_skip_empty.value then v.skip_empty = true end +if toolcontext.opt_no_inline.value then + v.no_inline = true +end for mmodule in mmodules do var nmodule = mbuilder.mmodule2node(mmodule)