nitc: cleanup and synchronize options with the manpage
authorJean Privat <jean@pryen.org>
Wed, 21 Oct 2015 02:31:40 +0000 (22:31 -0400)
committerJean Privat <jean@pryen.org>
Wed, 21 Oct 2015 12:42:53 +0000 (08:42 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

share/man/nitc.md
src/compiler/abstract_compiler.nit
src/compiler/separate_compiler.nit
src/loader.nit
src/mixin.nit
src/modelbuilder.nit
src/phase.nit
src/toolcontext.nit

index 4d703e9..2927a24 100644 (file)
@@ -45,7 +45,6 @@ See the documentation of these specific modules for details.
 ## MESSAGES
 
 ### `-W`, `--warn`
-
 Show additional warnings (advices).
 
 By default, only important warnings are displayed.
@@ -68,7 +67,6 @@ A warning is considered an advice when:
 in order to let people fix them before promoting the advice to an important warning.
 
 ### `-w`, `--warning`
-
 Show/hide a specific warning.
 
 Each type of warning can be individually displayed or hidden.
@@ -144,14 +142,14 @@ The path added with `-I` are searched before those added by the environment vari
 May be used more than once.
 
 ### `-o`, `--output`
-Output executable name.
+Filename of the generated executable.
 
 Indicates the path and name of the produced executable.
 
 Note: it is better to use `--dir` if only the directory is important.
 This way, the platform extension will be correctly set.
 
-### `-o` is not usable if multiple programs are compiled at once.
+`-o` is not usable if multiple programs are compiled at once.
 
 ### `--dir`
 Output directory.
@@ -188,7 +186,7 @@ The final binary will be generated in the same directory.
 
 Note that, to be useful, the compilation directory is not destroyed when `--no-cc` is used.
 
-### `-m`
+### `-m`, `--mixin`
 Additional module to mix-in.
 
 Additional modules are imported and refine the main module of the program.
@@ -316,7 +314,7 @@ This makes the compiled program faster since less indirections are required to g
 It also produces executables that are a little bit smaller since static memory does not have to store the colors.
 
 ### `--substitute-monomorph`
-Replace monomorphic trampolines with direct call.
+Replace monomorphic trampolines with direct calls.
 
 Late-binding is implemented with *trampolines*, that are small functions that just select and jump the to right implementations.
 If, at link-time, is it known that the target will always by the same implementation then all calls to the trampoline are replaced by
@@ -410,7 +408,7 @@ Disable advanced gcc directives for optimization.
 ### `--trampoline-call`
 Use an indirection when calling.
 
-Just add the trampolines of `--substitute-monomorph` without doing any aditionnal optimizations.
+Just add the trampolines of `--substitute-monomorph` without doing any additionnal optimizations.
 
 ### `--no-tag-primitives`
 Use only boxes for primitive types.
@@ -436,7 +434,9 @@ Do not check, and produce errors, on visibility issues.
 Do not generate main entry point.
 
 ### `--no-stacktrace`
-The compiled program will not display stack traces on runtime errors.
+Disable the generation of stack traces.
+
+With this option, the compiled program will not display stack traces on runtime errors.
 
 Because stack traces rely on libunwind, this option might be useful in order to generate more portable binaries
 since libunwind might be non available on the runtime system (or available with an ABI incompatible version).
index 55b644f..560dc60 100644 (file)
@@ -28,15 +28,15 @@ import counter
 # Add compiling options
 redef class ToolContext
        # --output
-       var opt_output = new OptionString("Output file", "-o", "--output")
+       var opt_output = new OptionString("Filename of the generated executable", "-o", "--output")
        # --dir
        var opt_dir = new OptionString("Output directory", "--dir")
        # --no-cc
-       var opt_no_cc = new OptionBool("Do not invoke C compiler", "--no-cc")
+       var opt_no_cc = new OptionBool("Do not invoke the C compiler", "--no-cc")
        # --no-main
        var opt_no_main = new OptionBool("Do not generate main entry point", "--no-main")
        # --make-flags
-       var opt_make_flags = new OptionString("Additional options to make", "--make-flags")
+       var opt_make_flags = new OptionString("Additional options to the `make` command", "--make-flags")
        # --max-c-lines
        var opt_max_c_lines = new OptionInt("Maximum number of lines in generated C files. Use 0 for unlimited", 10000, "--max-c-lines")
        # --group-c-files
@@ -50,7 +50,7 @@ redef class ToolContext
        # --no-check-attr-isset
        var opt_no_check_attr_isset = new OptionBool("Disable isset tests before each attribute access (dangerous)", "--no-check-attr-isset")
        # --no-check-assert
-       var opt_no_check_assert = new OptionBool("Disable the evaluation of explicit 'assert' and 'as' (dangerous)", "--no-check-assert")
+       var opt_no_check_assert = new OptionBool("Disable the evaluation of explicit `assert` and `as` (dangerous)", "--no-check-assert")
        # --no-check-autocast
        var opt_no_check_autocast = new OptionBool("Disable implicit casts on unsafe expression usage (dangerous)", "--no-check-autocast")
        # --no-check-null
@@ -66,11 +66,11 @@ redef class ToolContext
        # --no-stacktrace
        var opt_no_stacktrace = new OptionBool("Disable the generation of stack traces", "--no-stacktrace")
        # --no-gcc-directives
-       var opt_no_gcc_directive = new OptionArray("Disable a advanced gcc directives for optimization", "--no-gcc-directive")
+       var opt_no_gcc_directive = new OptionArray("Disable advanced gcc directives for optimization", "--no-gcc-directive")
        # --release
        var opt_release = new OptionBool("Compile in release mode and finalize application", "--release")
        # -g
-       var opt_debug = new OptionBool("Compile in debug mode (no C-side optimization)", "--debug", "-g")
+       var opt_debug = new OptionBool("Compile in debug mode (no C-side optimization)", "-g", "--debug")
 
        redef init
        do
index d3390af..f6c483c 100644 (file)
@@ -26,20 +26,20 @@ redef class ToolContext
        # --no-inline-intern
        var opt_no_inline_intern = new OptionBool("Do not inline call to intern methods", "--no-inline-intern")
        # --no-union-attribute
-       var opt_no_union_attribute = new OptionBool("Put primitive attibutes in a box instead of an union", "--no-union-attribute")
+       var opt_no_union_attribute = new OptionBool("Put primitive attributes in a box instead of an union", "--no-union-attribute")
        # --no-shortcut-equate
        var opt_no_shortcut_equate = new OptionBool("Always call == in a polymorphic way", "--no-shortcut-equal")
        # --no-tag-primitives
        var opt_no_tag_primitives = new OptionBool("Use only boxes for primitive types", "--no-tag-primitives")
 
        # --colors-are-symbols
-       var opt_colors_are_symbols = new OptionBool("Store colors as symbols (link-boost)", "--colors-are-symbols")
+       var opt_colors_are_symbols = new OptionBool("Store colors as symbols instead of static data (link-boost)", "--colors-are-symbols")
        # --trampoline-call
        var opt_trampoline_call = new OptionBool("Use an indirection when calling", "--trampoline-call")
        # --guard-call
        var opt_guard_call = new OptionBool("Guard VFT calls with a direct call", "--guard-call")
        # --substitute-monomorph
-       var opt_substitute_monomorph = new OptionBool("Replace monomorph trampoline with direct call (link-boost)", "--substitute-monomorph")
+       var opt_substitute_monomorph = new OptionBool("Replace monomorphic trampolines with direct calls (link-boost)", "--substitute-monomorph")
        # --link-boost
        var opt_link_boost = new OptionBool("Enable all link-boost optimizations", "--link-boost")
 
@@ -48,9 +48,9 @@ redef class ToolContext
        # --inline-some-methods
        var opt_inline_some_methods = new OptionBool("Allow the separate compiler to inline some methods (semi-global)", "--inline-some-methods")
        # --direct-call-monomorph
-       var opt_direct_call_monomorph = new OptionBool("Allow the separate compiler to direct call monomorph sites (semi-global)", "--direct-call-monomorph")
+       var opt_direct_call_monomorph = new OptionBool("Allow the separate compiler to direct call monomorphic sites (semi-global)", "--direct-call-monomorph")
        # --direct-call-monomorph0
-       var opt_direct_call_monomorph0 = new OptionBool("Allow the separate compiler to direct call monomorph sites (semi-global)", "--direct-call-monomorph0")
+       var opt_direct_call_monomorph0 = new OptionBool("Allow the separate compiler to direct call monomorphic sites (semi-global)", "--direct-call-monomorph0")
        # --skip-dead-methods
        var opt_skip_dead_methods = new OptionBool("Do not compile dead methods (semi-global)", "--skip-dead-methods")
        # --semi-global
@@ -60,7 +60,7 @@ redef class ToolContext
        # --tables-metrics
        var opt_tables_metrics = new OptionBool("Enable static size measuring of tables used for vft, typing and resolution", "--tables-metrics")
        # --type-poset
-       var opt_type_poset = new OptionBool("Build a poset of types to create more condensed tables.", "--type-poset")
+       var opt_type_poset = new OptionBool("Build a poset of types to create more condensed tables", "--type-poset")
 
        redef init
        do
index 9b79c62..ac9f91d 100644 (file)
@@ -42,13 +42,13 @@ import ini
 
 redef class ToolContext
        # Option --path
-       var opt_path = new OptionArray("Set include path for loaders (may be used more than once)", "-I", "--path")
+       var opt_path = new OptionArray("Add an additional include path (may be used more than once)", "-I", "--path")
 
        # Option --only-metamodel
        var opt_only_metamodel = new OptionBool("Stop after meta-model processing", "--only-metamodel")
 
        # Option --only-parse
-       var opt_only_parse = new OptionBool("Only proceed to parse step of loaders", "--only-parse")
+       var opt_only_parse = new OptionBool("Only proceed to parse files", "--only-parse")
 
        redef init
        do
index d70313d..508fc67 100644 (file)
@@ -21,7 +21,7 @@ import modelbuilder
 
 redef class ToolContext
        # --mixin
-       var opt_mixins = new OptionArray("Additionals module to min-in", "-m", "--mixin")
+       var opt_mixins = new OptionArray("Additional module to mix-in", "-m", "--mixin")
        # --define
        var opt_defines = new OptionArray("Define a specific property", "-D", "--define")
 
index 2a28de4..00e41b5 100644 (file)
@@ -25,7 +25,7 @@ private import more_collections
 
 redef class ToolContext
        # Option --ignore-visibility
-       var opt_ignore_visibility = new OptionBool("Do not check, and produce errors, on visibility issues.", "--ignore-visibility")
+       var opt_ignore_visibility = new OptionBool("Do not check, and produce errors, on visibility issues", "--ignore-visibility")
 
        redef init
        do
index 682d23e..c94dcdc 100644 (file)
@@ -28,10 +28,10 @@ redef class ToolContext
        var phases = new POSet[Phase]
 
        # --disable-phase
-       var opt_disable_phase = new OptionArray("DEBUG: Disable a specific phase; use `list` to get the list.", "--disable-phase")
+       var opt_disable_phase = new OptionArray("Disable a specific phase; use `list` to get the list (debug)", "--disable-phase")
 
-       # --disable-phase
-       var opt_sloppy = new OptionBool("DEBUG: force lazy semantic analysis of the source-code", "--sloppy")
+       # --sloppy
+       var opt_sloppy = new OptionBool("Force lazy semantic analysis of the source-code (debug)", "--sloppy")
 
        redef init
        do
index 98b746a..bdd6338 100644 (file)
@@ -333,7 +333,7 @@ class ToolContext
        var option_context = new OptionContext
 
        # Option --warn
-       var opt_warn = new OptionCount("Show more warnings", "-W", "--warn")
+       var opt_warn = new OptionCount("Show additional warnings (advices)", "-W", "--warn")
 
        # Option --warning
        var opt_warning = new OptionArray("Show/hide a specific warning", "-w", "--warning")
@@ -360,10 +360,10 @@ class ToolContext
        var opt_set_dummy_tool = new OptionBool("Set toolname and version to DUMMY. Useful for testing", "--set-dummy-tool")
 
        # Option --verbose
-       var opt_verbose = new OptionCount("Verbose", "-v", "--verbose")
+       var opt_verbose = new OptionCount("Additional messages from the tool", "-v", "--verbose")
 
        # Option --stop-on-first-error
-       var opt_stop_on_first_error = new OptionBool("Stop on first error", "--stop-on-first-error")
+       var opt_stop_on_first_error = new OptionBool("Just display the first encountered error then stop", "--stop-on-first-error")
 
        # Option --keep-going
        var opt_keep_going = new OptionBool("Continue after errors, whatever the consequences", "--keep-going")
@@ -440,26 +440,23 @@ class ToolContext
 
                if opt_stub_man.value then
                        print """
-% {{{toolname.to_upper}}}(1)
-
 # NAME
 
 {{{tooldescription.split("\n")[1]}}}
 
 # SYNOPSYS
 
-{{{toolname}}} [*options*]...
-
 # OPTIONS
 """
                        for o in option_context.options do
                                var first = true
+                               printn "### "
                                for n in o.names do
                                        if first then first = false else printn ", "
                                        printn "`{n}`"
                                end
                                print ""
-                               print ":   {o.helptext}"
+                               print "{o.helptext}."
                                print ""
                        end
                        print """