diff --git a/src/jloptions.c b/src/jloptions.c index 6980d4b8b235c..3a2c26165e63e 100644 --- a/src/jloptions.c +++ b/src/jloptions.c @@ -106,133 +106,159 @@ JL_DLLEXPORT void jl_init_options(void) static const char usage[] = "\n julia [switches] -- [programfile] [args...]\n\n"; static const char opts[] = - "Switches (a '*' marks the default value, if applicable; settings marked '($)' may trigger package precompilation):\n\n" - " -v, --version Display version information\n" - " -h, --help Print command-line options (this message)\n" - " --help-hidden Print uncommon options not shown by `-h`\n\n" + "Switches (a '*' marks the default value, if applicable; settings marked '($)' may trigger package\n" + "precompilation):\n\n" + " Option Description\n" + " ---------------------------------------------------------------------------------------------------\n" + " -v, --version Display version information\n" + " -h, --help Print command-line options (this message)\n" + " --help-hidden Print uncommon options not shown by `-h`\n\n" // startup options - " --project[={|@.}] Set as the active project/environment.\n" - " The default @. option will search through parent directories\n" - " until a Project.toml or JuliaProject.toml file is found.\n" - " -J, --sysimage Start up with the given system image file\n" - " -H, --home Set location of `julia` executable\n" - " --startup-file={yes*|no} Load `JULIA_DEPOT_PATH/config/startup.jl`; if `JULIA_DEPOT_PATH`\n" - " environment variable is unset, load `~/.julia/config/startup.jl`\n" - " --handle-signals={yes*|no} Enable or disable Julia's default signal handlers\n" - " --sysimage-native-code={yes*|no}\n" - " Use native code from system image if available\n" - " --compiled-modules={yes*|no|existing|strict}\n" - " Enable or disable incremental precompilation of modules\n" - " The `existing` option allows use of existing compiled modules that were\n" - " previously precompiled, but disallows creation of new precompile files.\n" - " The `strict` option is similar, but will error if no precompile file is found.\n" - " --pkgimages={yes*|no|existing}\n" - " Enable or disable usage of native code caching in the form of pkgimages\n" - " The `existing` option allows use of existing pkgimages but disallows creation of new ones ($)\n\n" + " --project[={|@.}] Set as the active project/environment.\n" + " The default @. option will search through parent\n" + " directories until a Project.toml or JuliaProject.toml\n" + " file is found.\n" + " -J, --sysimage Start up with the given system image file\n" + " -H, --home Set location of `julia` executable\n" + " --startup-file={yes*|no} Load `JULIA_DEPOT_PATH/config/startup.jl`; \n" + " if `JULIA_DEPOT_PATH` environment variable is unset,\n" + " load `~/.julia/config/startup.jl`\n" + " --handle-signals={yes*|no} Enable or disable Julia's default signal handlers\n" + " --sysimage-native-code={yes*|no} Use native code from system image if available\n" + " --compiled-modules={yes*|no|existing|strict} Enable or disable incremental precompilation of\n" + " modules. The `existing` option allows use of existing\n" + " compiled modules that were previously precompiled,\n" + " but disallows creation of new precompile files.\n" + " The `strict` option is similar, but will error if no\n" + " precompile file is found.\n" + " --pkgimages={yes*|no|existing} Enable or disable usage of native code caching in the\n" + " form of pkgimages. The `existing` option allows use\n" + " of existing pkgimages but disallows creation of new\n" + " ones ($)\n\n" // actions - " -e, --eval Evaluate \n" - " -E, --print Evaluate and display the result\n" - " -m, --module [args]\n" - " Run entry point of `Package` (`@main` function) with `args'.\n" - " -L, --load Load immediately on all processors\n\n" + " -e, --eval Evaluate \n" + " -E, --print Evaluate and display the result\n" + " -m, --module [args] Run entry point of `Package` (`@main` function) with\n" + " `args'.\n" + " -L, --load Load immediately on all processors\n\n" // parallel options - " -t, --threads {auto|N[,auto|M]}\n" - " Enable N[+M] threads; N threads are assigned to the `default`\n" - " threadpool, and if M is specified, M threads are assigned to the\n" - " `interactive` threadpool; `auto` tries to infer a useful\n" - " default number of threads to use but the exact behavior might change\n" - " in the future. Currently sets N to the number of CPUs assigned to\n" - " this Julia process based on the OS-specific affinity assignment\n" - " interface if supported (Linux and Windows) or to the number of CPU\n" - " threads if not supported (MacOS) or if process affinity is not\n" - " configured, and sets M to 1.\n" - " --gcthreads=N[,M] Use N threads for the mark phase of GC and M (0 or 1) threads for the concurrent sweeping phase of GC.\n" - " N is set to half of the number of compute threads and M is set to 0 if unspecified.\n" - " -p, --procs {N|auto} Integer value N launches N additional local worker processes\n" - " `auto` launches as many workers as the number of local CPU threads (logical cores)\n" - " --machine-file Run processes on hosts listed in \n\n" + " -t, --threads {auto|N[,auto|M]} Enable N[+M] threads; N threads are assigned to the\n" + " `default` threadpool, and if M is specified, M\n" + " threads are assigned to the `interactive`\n" + " threadpool; `auto` tries to infer a useful\n" + " default number of threads to use but the exact\n" + " behavior might change in the future. Currently sets\n" + " N to the number of CPUs assigned to this Julia\n" + " process based on the OS-specific affinity assignment\n" + " interface if supported (Linux and Windows) or to the\n" + " number of CPU threads if not supported (MacOS) or if\n" + " process affinity is not configured, and sets M to 1.\n" + " --gcthreads=N[,M] Use N threads for the mark phase of GC and M (0 or 1)\n" + " threads for the concurrent sweeping phase of GC.\n" + " N is set to half of the number of compute threads and\n" + " M is set to 0 if unspecified.\n" + " -p, --procs {N|auto} Integer value N launches N additional local worker\n" + " processes `auto` launches as many workers as the\n" + " number of local CPU threads (logical cores).\n" + " --machine-file Run processes on hosts listed in \n\n" // interactive options - " -i, --interactive Interactive mode; REPL runs and `isinteractive()` is true\n" - " -q, --quiet Quiet startup: no banner, suppress REPL warnings\n" - " --banner={yes|no|short|auto*}\n" - " Enable or disable startup banner\n" - " --color={yes|no|auto*} Enable or disable color text\n" - " --history-file={yes*|no} Load or save history\n\n" + " -i, --interactive Interactive mode; REPL runs and\n" + " `isinteractive()` is true.\n" + " -q, --quiet Quiet startup: no banner, suppress REPL warnings\n" + " --banner={yes|no|short|auto*} Enable or disable startup banner\n" + " --color={yes|no|auto*} Enable or disable color text\n" + " --history-file={yes*|no} Load or save history\n\n" // error and warning options - " --depwarn={yes|no*|error} Enable or disable syntax and method deprecation warnings (`error` turns warnings into errors)\n" - " --warn-overwrite={yes|no*} Enable or disable method overwrite warnings\n" - " --warn-scope={yes*|no} Enable or disable warning for ambiguous top-level scope\n\n" + " --depwarn={yes|no*|error} Enable or disable syntax and method deprecation\n" + " warnings (`error` turns warnings into errors)\n" + " --warn-overwrite={yes|no*} Enable or disable method overwrite warnings\n" + " --warn-scope={yes*|no} Enable or disable warning for ambiguous top-level\n" + " scope\n\n" // code generation options - " -C, --cpu-target Limit usage of CPU features up to ; set to `help` to see the available options\n" - " -O, --optimize={0|1|2*|3} Set the optimization level (level 3 if `-O` is used without a level) ($)\n" - " --min-optlevel={0*|1|2|3} Set a lower bound on the optimization level\n" + " -C, --cpu-target Limit usage of CPU features up to ; set to\n" + " `help` to see the available options\n" + " -O, --optimize={0|1|2*|3} Set the optimization level (level 3 if `-O` is used\n" + " without a level) ($)\n" + " --min-optlevel={0*|1|2|3} Set a lower bound on the optimization level\n" #ifdef JL_DEBUG_BUILD - " -g, --debug-info=[{0|1|2*}] Set the level of debug info generation in the julia-debug build ($)\n" + " -g, --debug-info=[{0|1|2*}] Set the level of debug info generation in the\n" + " julia-debug build ($)\n" #else - " -g, --debug-info=[{0|1*|2}] Set the level of debug info generation (level 2 if `-g` is used without a level) ($)\n" + " -g, --debug-info=[{0|1*|2}] Set the level of debug info generation (level 2 if\n" + " `-g` is used without a level) ($)\n" #endif - " --inline={yes*|no} Control whether inlining is permitted, including overriding @inline declarations\n" - " --check-bounds={yes|no|auto*}\n" - " Emit bounds checks always, never, or respect @inbounds declarations ($)\n" - " --math-mode={ieee|user*} Always follow `ieee` floating point semantics or respect `@fastmath` declarations\n\n" + " --inline={yes*|no} Control whether inlining is permitted, including\n" + " overriding @inline declarations\n" + " --check-bounds={yes|no|auto*} Emit bounds checks always, never, or respect\n" + " @inbounds declarations ($)\n" + " --math-mode={ieee|user*} Always follow `ieee` floating point semantics or\n" + " respect `@fastmath` declarations\n\n" #ifdef USE_POLLY - " --polly={yes*|no} Enable or disable the polyhedral optimizer Polly (overrides @polly declaration)\n" + " --polly={yes*|no} Enable or disable the polyhedral optimizer Polly\n" + " (overrides @polly declaration)\n" #endif // instrumentation options - " --code-coverage[={none*|user|all}]\n" - " Count executions of source lines (omitting setting is equivalent to `user`)\n" - " --code-coverage=@\n" - " Count executions but only in files that fall under the given file path/directory.\n" - " The `@` prefix is required to select this option. A `@` with no path will track the\n" - " current directory.\n" + " --code-coverage[={none*|user|all}] Count executions of source lines (omitting setting is\n" + " equivalent to `user`)\n" + " --code-coverage=@ Count executions but only in files that fall under\n" + " the given file path/directory. The `@` prefix is\n" + " required to select this option. A `@` with no path\n" + " will track the current directory.\n" - " --code-coverage=tracefile.info\n" - " Append coverage information to the LCOV tracefile (filename supports format tokens)\n" + " --code-coverage=tracefile.info Append coverage information to the LCOV tracefile\n" + " (filename supports format tokens)\n" // TODO: These TOKENS are defined in `runtime_ccall.cpp`. A more verbose `--help` should include that list here. - " --track-allocation[={none*|user|all}]\n" - " Count bytes allocated by each source line (omitting setting is equivalent to `user`)\n" - " --track-allocation=@\n" - " Count bytes but only in files that fall under the given file path/directory.\n" - " The `@` prefix is required to select this option. A `@` with no path will track the\n" - " current directory.\n" - " --bug-report=KIND Launch a bug report session. It can be used to start a REPL, run a script, or evaluate\n" - " expressions. It first tries to use BugReporting.jl installed in current environment and\n" - " fallbacks to the latest compatible BugReporting.jl if not. For more information, see\n" - " --bug-report=help.\n\n" - " --heap-size-hint= Forces garbage collection if memory usage is higher than the given value.\n" - " The value may be specified as a number of bytes, optionally in units of\n" - " KB, MB, GB, or TB, or as a percentage of physical memory with %.\n\n" + " --track-allocation[={none*|user|all}] Count bytes allocated by each source line (omitting\n" + " setting is equivalent to `user`)\n" + " --track-allocation=@ Count bytes but only in files that fall under the\n" + " given file path/directory. The `@` prefix is required\n" + " to select this option. A `@` with no path will track\n" + " the current directory.\n" + " --bug-report=KIND Launch a bug report session. It can be used to start\n" + " a REPL, run a script, or evaluate expressions. It\n" + " first tries to use BugReporting.jl installed in\n" + " current environment and fallbacks to the latest\n" + " compatible BugReporting.jl if not. For more\n" + " information, see --bug-report=help.\n\n" + " --heap-size-hint= Forces garbage collection if memory usage is higher\n" + " than the given value. The value may be specified as a\n" + " number of bytes, optionally in units of KB, MB, GB,\n" + " or TB, or as a percentage of physical memory with %.\n\n" ; static const char opts_hidden[] = "Switches (a '*' marks the default value, if applicable):\n\n" + " Option Description\n" + " ---------------------------------------------------------------------------------------------------\n" // code generation options - " --compile={yes*|no|all|min}\n" - " Enable or disable JIT compiler, or request exhaustive or minimal compilation\n\n" + " --compile={yes*|no|all|min} Enable or disable JIT compiler, or request exhaustive\n" + " or minimal compilation\n\n" // compiler output options - " --output-o Generate an object file (including system image data)\n" - " --output-ji Generate a system image data file (.ji)\n" - " --strip-metadata Remove docstrings and source location info from system image\n" - " --strip-ir Remove IR (intermediate representation) of compiled functions\n\n" + " --output-o Generate an object file (including system image data)\n" + " --output-ji Generate a system image data file (.ji)\n" + " --strip-metadata Remove docstrings and source location info from\n" + " system image\n" + " --strip-ir Remove IR (intermediate representation) of compiled\n" + " functions\n\n" // compiler debugging (see the devdocs for tips on using these options) - " --output-unopt-bc Generate unoptimized LLVM bitcode (.bc)\n" - " --output-bc Generate LLVM bitcode (.bc)\n" - " --output-asm Generate an assembly file (.s)\n" - " --output-incremental={yes|no*}\n" - " Generate an incremental output file (rather than complete)\n" - " --trace-compile={stderr|name}\n" - " Print precompile statements for methods compiled during execution or save to a path\n" - " --image-codegen Force generate code in imaging mode\n" - " --permalloc-pkgimg={yes|no*} Copy the data section of package images into memory\n" + " --output-unopt-bc Generate unoptimized LLVM bitcode (.bc)\n" + " --output-bc Generate LLVM bitcode (.bc)\n" + " --output-asm Generate an assembly file (.s)\n" + " --output-incremental={yes|no*} Generate an incremental output file (rather than\n" + " complete)\n" + " --trace-compile={stderr|name} Print precompile statements for methods compiled\n" + " during execution or save to a path\n" + " --image-codegen Force generate code in imaging mode\n" + " --permalloc-pkgimg={yes|no*} Copy the data section of package images into memory\n" ; JL_DLLEXPORT void jl_parse_opts(int *argcp, char ***argvp)