       1 #
       2 # Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved.
       3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       4 #
       5 # This code is free software; you can redistribute it and/or modify it
       6 # under the terms of the GNU General Public License version 2 only, as
       7 # published by the Free Software Foundation.  Oracle designates this
       8 # particular file as subject to the "Classpath" exception as provided
       9 # by Oracle in the LICENSE file that accompanied this code.
      10 #
      11 # This code is distributed in the hope that it will be useful, but WITHOUT
      12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
      13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      14 # version 2 for more details (a copy is included in the LICENSE file that
      15 # accompanied this code).
      16 #
      17 # You should have received a copy of the GNU General Public License version
      18 # 2 along with this work; if not, write to the Free Software Foundation,
      19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
      20 #
      21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
      22 # or visit www.oracle.com if you need additional information or have any
      23 # questions.
      24 #
      25 option.error.invalid.option="{0}" is not a recognized option. Use "{1}" or "{2}" to see a list of all supported options.
      26
      27 nashorn.options = Usage: jjs [option=value]* [filename.js]+ [-- options...]\n\
      28                 \n\
      29                 Valid options are:
      30
      31 #
      32 # Localized meta descriptions
      33 #
      34 nashorn.options.param = param
      35 nashorn.options.default = default
      36
      37 #
      38 # Which option is "help".
      39 #
      40 nashorn.options.help.key = nashorn.option.help
      41
      42 #
      43 # Which option is "xhelp".
      44 #
      45 nashorn.options.xhelp.key = nashorn.option.xhelp
      46
      47 #
      48 # Which option is "D".
      49 #
      50 nashorn.options.D.key = nashorn.option.D
      51
      52 ##
      53 ## Grammar: at least short or long form. Arguments are optional, in that case they are given as
      54 ##
      55 ## params - a description of the parameters for command line usage
      56 ## name - the name of the option, e.g. "--long-name"
      57 ## short_name - the short name of the option, e.g. "-l"
      58 ## type - the type of the option, currently allowed: boolean, integer, string, log, timezone. defaults to boolean if left out
      59 ## is_undocumented - should this option never appear in the online help. defaults to no.
      60 ## desc - description of what the option does
      61 ## default - default value of the option. e.g. debug.lines is true by default. Not set means option not available by default
      62 ## dependency - does this arg imply another arg.
      63 ## confict - does this arg conflict with another arg e.g trace && instrument
      64 ## value_next_arg - is the opton's value passed as next argument in command line?
      65 ##
      66 ## At least short_name or name needs to be in place for an argument descriptor to be valid.
      67
      68 nashorn.option.help = {                       \
      69     name="--help",                            \
      70     short_name="-h",                          \
      71     desc="Print this help message."           \
      72 }
      73
      74 nashorn.option.xhelp = {                               \
      75     name="-xhelp",                                     \
      76     is_undocumented=true,                              \
      77     desc="Print extended help for command line flags." \
      78 }
      79
      80 nashorn.option.anonymous.classes = {                      \
      81     name="--anonymous-classes",                           \
      82     is_undocumented=true,                                 \
      83     params=[auto|true|false],                             \
      84     default=auto,                                         \
      85     type=string,                                          \
      86     desc="Use VM anonymous classes for compiled scripts." \
      87 }
      88
      89 nashorn.option.class.cache.size ={                            \
      90     name="--class-cache-size",                                \
      91     short_name="-ccs",                                        \
      92     desc="Size of the Class cache size per global scope.",    \
      93     is_undocumented=true,                                     \
      94     type=Integer,                                             \
      95     default=50                                                \
      96 }
      97
      98 nashorn.option.classpath ={                                   \
      99     name="-classpath",                                        \
     100     short_name="-cp",                                         \
     101     desc="-cp path. Specify where to find user class files.", \
     102     value_next_arg=true,                                      \
     103     type=String                                               \
     104 }
     105
     106 nashorn.option.compile.only = {       \
     107     name="--compile-only",            \
     108     short_name="-co",                 \
     109     is_undocumented=true,             \
     110     desc="Compile without running.",  \
     111     type=Boolean                      \
     112 }
     113
     114 nashorn.option.const.as.var = {          \
     115     name="--const-as-var",               \
     116     is_undocumented=true,                \
     117     desc="Replace 'const' with 'var'.",  \
     118     type=Boolean                         \
     119 }
     120
     121 nashorn.option.d = {                                             \
     122     name="--dump-debug-dir",                                     \
     123     short_name="-d",                                             \
     124     is_undocumented=true,                                        \
     125     params="<path>",                                             \
     126     desc="specify a destination directory to dump source and class files.", \
     127     type=String                                                  \
     128 }
     129
     130 nashorn.option.D = {                                                          \
     131     name="-D",                                                                \
     132     desc="-Dname=value. Set a system property. This option can be repeated.", \
     133     type=String                                                               \
     134 }
     135
     136 nashorn.option.debug.lines = {                          \
     137     name="--debug-lines",                               \
     138     is_undocumented=true,                               \
     139     desc="Generate line number table in .class files.", \
     140     default=true                                        \
     141 }
     142
     143 nashorn.option.debug.locals = {                           \
     144     name="--debug-locals",                                \
     145     is_undocumented=true,                                 \
     146     desc="Generate local variable table in .class files." \
     147 }
     148
     149 nashorn.option.debug.scopes = {                                 \
     150     name="--debug-scopes",                                      \
     151     is_undocumented=true,                                       \
     152     desc="Put all variables in scopes to make them debuggable." \
     153 }
     154
     155 nashorn.option.doe = {                   \
     156     name="-dump-on-error",               \
     157     short_name="-doe",                   \
     158     desc="Dump a stack trace on errors." \
     159 }
     160
     161 nashorn.option.empty.statements = {          \
     162     name="--empty-statements",               \
     163     is_undocumented=true,                    \
     164     desc="Preserve empty statements in AST." \
     165 }
     166
     167 nashorn.option.early.lvalue.error = {                                      \
     168     name="--early-lvalue-error",                                           \
     169     is_undocumented=true,                                                  \
     170     desc="invalid lvalue expressions should be reported as early errors.", \
     171     type=Boolean,                                                          \
     172     default=true                                                           \
     173 }
     174
     175 nashorn.option.fullversion = {                 \
     176     name="-fullversion",                       \
     177     short_name="-fv",                          \
     178     desc="Print full version info of Nashorn." \
     179 }
     180
     181 nashorn.option.function.statement.error= {                                    \
     182     name="--function-statement-error",                                        \
     183     desc="Report an error when function declaration is used as a statement.", \
     184     is_undocumented=true,                                                     \
     185     default=false                                                             \
     186 }
     187
     188 nashorn.option.function.statement.warning = {                      \
     189     name="--function-statement-warning",                           \
     190     desc="Warn when function declaration is used as a statement.", \
     191     is_undocumented=true,                                          \
     192     default=false                                                  \
     193 }
     194
     195 nashorn.option.fx = {                           \
     196     name="-fx",                                 \
     197     desc="Launch script as an fx application.", \
     198     default=false                               \
     199 }
     200
     201 nashorn.option.global.per.engine = {            \
     202     name="--global-per-engine",                 \
     203     desc="Use single Global instance per script engine instance.", \
     204     is_undocumented=true,                                          \
     205     type=Boolean,                               \
     206     default=false                               \
     207 }
     208
     209 nashorn.option.language = {                      \
     210     name="--language",                           \
     211     type=String,                                 \
     212     params=[es5|es6],                            \
     213     default=es5,                                 \
     214     desc="Specify ECMAScript language version."  \
     215 }
     216
     217 nashorn.option.log = {                                                       \
     218     name="--log",                                                            \
     219     is_undocumented=true,                                                    \
     220     params="<module:level>,*",                                               \
     221     desc="Enable logging of a given level for a given number of sub systems. \
     222         [for example: --log=fields:finest,codegen:info].",                   \
     223     type=Log                                                                 \
     224 }
     225

     226 nashorn.option.lazy.compilation = {                                                                      \
     227     name="--lazy-compilation",                                                                           \
     228     is_undocumented=true,                                                                                \
     229     desc="Use lazy code generation strategies - do not compile the entire script at once.", \
     230     default=true                                   \
     231 }
     232
     233 nashorn.option.loader.per.compile = {              \
     234     name="--loader-per-compile",                   \
     235     is_undocumented=true,                          \
     236     desc="Create a new class loader per compile.", \
     237     default=true                                   \
     238 }
     239
     240 nashorn.option.module.path ={                                 \
     241     name="--module-path",                                     \
     242     desc="--module-path path. Specify where to find user java modules.", \
     243     value_next_arg=true,                                      \
     244     type=String                                               \
     245 }
     246
     247 nashorn.option.add.modules ={                                 \
     248     name="--add-modules",                                     \
     249     desc="--add-modules modules. Specify the root user java modules.", \
     250     repeated=true,                                            \
     251     value_next_arg=true,                                      \
     252     type=String                                               \
     253 }
     254
     255 nashorn.option.no.java = {                         \
     256     name="--no-java",                              \
     257     short_name="-nj",                              \
     258     is_undocumented=true,                          \
     259     desc="Disable Java support.",                  \
     260     default=false                                  \
     261 }
     262
     263 nashorn.option.no.syntax.extensions = {              \
     264     name="--no-syntax-extensions",                   \
     265     short_name="-nse",                               \
     266     is_undocumented=true,                            \
     267     desc="Disallow non-standard syntax extensions.", \
     268     default=false                                    \
     269 }
     270
     271 nashorn.option.no.typed.arrays = {                 \
     272     name="--no-typed-arrays",                      \
     273     short_name="-nta",                             \
     274     is_undocumented=true,                          \
     275     desc="Disable typed arrays support.",          \
     276     default=false                                  \
     277 }
     278
     279 nashorn.option.optimistic.types = {                                                                      \
     280     name="--optimistic-types",                                                                           \
     281     short_name="-ot",                                                                                    \
     282     desc="Use optimistic type assumptions with deoptimizing recompilation. This makes the compiler try, for any program symbol whose type cannot be proven at compile time, to type it as narrow and primitive as possible. If the runtime encounters an error because symbol type is too narrow, a wider method will be generated until steady stage is reached. While this produces as optimal Java Bytecode as possible, erroneous type guesses will lead to longer warmup. Optimistic typing is currently enabled by default, but can be disabled for faster startup performance.",                     \
     283     default=true                                                                                         \
     284 }
     285
     286 nashorn.option.parse.only = {       \
     287     name="--parse-only",            \
     288     is_undocumented=true,           \
     289     desc="Parse without compiling." \
     290 }
     291
     292 nashorn.option.persistent.code.cache = {            \
     293     name="--persistent-code-cache",                 \
     294     short_name="-pcc",                              \
     295     desc="Enable disk cache for compiled scripts.", \
     296     is_undocumented=true,                           \
     297     default=false                                   \
     298 }
     299
     300 nashorn.option.profile.callsites = {   \
     301     name="--profile-callsites",        \
     302     short_name="-pcs",                 \
     303     is_undocumented=true,              \
     304     desc="Dump callsite profile data." \
     305 }
     306
     307 nashorn.option.print.ast = {            \
     308     name="--print-ast",                 \
     309     is_undocumented=true,               \
     310     desc="Print abstract syntax tree."  \
     311 }
     312
     313 nashorn.option.print.lower.ast = {              \
     314     name="--print-lower-ast",                   \
     315     is_undocumented=true,                       \
     316     desc="Print lowered abstract syntax tree."  \
     317 }
     318
     319 nashorn.option.print.code = { \
     320     name="--print-code",      \
     321     short_name="-pc",         \
     322     is_undocumented=true,     \
     323     params="[dir:<output-dir>,function:<name>]", \
     324     type=keyvalues,           \
     325     desc="Print generated bytecode. If a directory is specified, nothing will be dumped to stderr. Also, in that case, .dot files will be generated for all functions or for the function with the specified name only."  \
     326 }
     327
     328 nashorn.option.print.no.newline = {                     \
     329     name="--print-no-newline",                          \
     330     is_undocumented=true,                               \
     331     desc="Print function will not print new line char." \
     332 }
     333
     334 nashorn.option.print.parse = {   \
     335     name="--print-parse",        \
     336     short_name="-pp",            \
     337     is_undocumented=true,        \
     338     desc="Print the parse tree." \
     339 }
     340
     341 nashorn.option.print.lower.parse = {            \
     342     name="--print-lower-parse",                 \
     343     short_name="-plp",                          \
     344     is_undocumented=true,                       \
     345     desc="Print the parse tree after lowering." \
     346 }
     347
     348 nashorn.option.print.symbols = {   \
     349     name="--print-symbols",        \
     350     is_undocumented=true,          \
     351     desc="Print the symbol table." \
     352 }
     353
     354 nashorn.option.strict = {              \
     355     name="-strict",                    \
     356     desc="Run scripts in strict mode." \
     357 }
     358
     359 nashorn.option.scripting = {            \
     360     name="-scripting",                  \
     361     desc="Enable scripting features."   \
     362 }
     363
     364 nashorn.option.stdout = {                                                \
     365     name="--stdout",                                                     \
     366     is_undocumented=true,                                                \
     367     type=String,                                                         \
     368     params="<output console>",                                           \
     369     desc="Redirect stdout to a filename or to another tty, e.g. stderr." \
     370 }
     371
     372 nashorn.option.stderr = {                                                \
     373     name="--stderr",                                                     \
     374     is_undocumented=true,                                                \
     375     type=String,                                                         \
     376     params="<output console>",                                           \
     377     desc="Redirect stderr to a filename or to another tty, e.g. stdout." \
     378 }
     379
     380 nashorn.option.timezone = {                    \
     381     name="-timezone",                          \
     382     short_name="-t",                           \
     383     params="<timezone>",                       \
     384     desc="Set timezone for script execution.", \
     385     type=TimeZone                              \
     386 }
     387
     388 nashorn.option.locale = {                    \
     389     name="--locale",                         \
     390     short_name="-l",                         \
     391     is_undocumented=true,                    \
     392     params="<locale>",                       \
     393     desc="Set Locale for script execution.", \
     394     type=Locale                              \
     395 }
     396
     397 nashorn.option.trace.callsites = {                                               \
     398     name="--trace-callsites",                                                    \
     399     short_name="-tcs",                                                           \
     400     is_undocumented=true,                                                        \
     401     type=keyvalues,                                                              \
     402     params="[=[option,]*]",                                                      \
     403     desc="Enable callsite trace mode. Options are: miss [trace callsite misses]  \
     404     enterexit [trace callsite enter/exit], objects [print object properties]."   \
     405 }
     406
     407 nashorn.option.unstable.relink.threshold ={                   \
     408     name="--unstable-relink-threshold",                       \
     409     short_name="-urt",                                        \
     410     desc="Number of times a dynamic call site has to be       \
     411     relinked before it is considered unstable, when the       \
     412     runtime will try to link it as if it is megamorphic.",    \
     413     is_undocumented=true,                                     \
     414     type=Integer,                                             \
     415     default=-1                                                \
     416 }
     417
     418
     419 nashorn.option.verify.code = {              \
     420     name="--verify-code",                   \
     421     is_undocumented=true,                   \
     422     desc="Verify byte code before running." \
     423 }
     424
     425 nashorn.option.version = {                \
     426     name="-version",                      \
     427     short_name="-v",                      \
     428     desc="Print version info of Nashorn." \
     429 }
     430
    --- EOF ---