1 #
   2 # Copyright (c) 2010, 2013, 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 help for command line flags." \
  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.class.cache.size ={                            \
  81     name="--class-cache-size",                                \
  82     short_name="-ccs",                                        \
  83     desc="Size of the Class cache size per global scope.",    \
  84     is_undocumented=true,                                     \
  85     type=Integer,                                             \
  86     default=50                                                \
  87 }
  88 
  89 nashorn.option.classpath ={                                   \
  90     name="-classpath",                                        \
  91     short_name="-cp",                                         \
  92     desc="-cp path. Specify where to find user class files.", \
  93     value_next_arg=true,                                      \
  94     type=String                                               \
  95 }
  96 
  97 nashorn.option.compile.only = {       \
  98     name="--compile-only",            \
  99     short_name="-co",                 \
 100     is_undocumented=true,             \
 101     desc="Compile without running.",  \
 102     type=Boolean                      \
 103 }
 104 
 105 nashorn.option.d = {                                             \
 106     name="--dump-debug-dir",                                     \
 107     short_name="-d",                                             \
 108     is_undocumented=true,                                        \
 109     params="<path>",                                             \
 110     desc="specify a destination directory to dump class files.", \
 111     type=String                                                  \
 112 }
 113 
 114 nashorn.option.doe = {                   \
 115     name="-dump-on-error",               \
 116     short_name="-doe",                   \
 117     desc="Dump a stack trace on errors." \
 118 }
 119 
 120 nashorn.option.empty.statements = {          \
 121     name="--empty-statements",               \
 122     is_undocumented=true,                    \
 123     desc="Preserve empty statements in AST." \
 124 }
 125 
 126 nashorn.option.early.lvalue.error = {                                      \
 127     name="--early-lvalue-error",                                           \
 128     is_undocumented=true,                                                  \
 129     desc="invalid lvalue expressions should be reported as early errors.", \
 130     type=Boolean,                                                          \
 131     default=true                                                           \
 132 }
 133 
 134 nashorn.option.fullversion = {                 \
 135     name="-fullversion",                       \
 136     short_name="-fv",                          \
 137     desc="Print full version info of Nashorn." \
 138 }
 139 
 140 nashorn.option.function.statement.error= {                                    \
 141     name="--function-statement-error",                                        \
 142     desc="Report an error when function declaration is used as a statement.", \
 143     is_undocumented=true,                                                     \
 144     default=false                                                             \
 145 }
 146 
 147 nashorn.option.function.statement.warning = {                      \
 148     name="--function-statement-warning",                           \
 149     desc="Warn when function declaration is used as a statement.", \
 150     is_undocumented=true,                                          \
 151     default=false                                                  \
 152 }
 153 
 154 nashorn.option.fx = {                           \
 155     name="-fx",                                 \
 156     desc="Launch script as an fx application.", \
 157     default=false                               \
 158 }
 159 
 160 nashorn.option.log = {                                                       \
 161     name="--log",                                                            \
 162     is_undocumented=true,                                                    \
 163     params="<module:level>,*",                                               \
 164     desc="Enable logging of a given level for a given number of sub systems. \
 165         [for example: --log=fields:finest,codegen:info]",                    \
 166     type=Log                                                                 \
 167 }
 168 
 169 nashorn.option.debug.lines = {                          \
 170     name="--debug-lines",                               \
 171     is_undocumented=true,                               \
 172     desc="Generate line number table in .class files.", \
 173     default=true                                        \
 174 }
 175 
 176 nashorn.option.debug.locals = {                           \
 177     name="--debug-locals",                                \
 178     is_undocumented=true,                                 \
 179     desc="Generate local variable table in .class files." \
 180 }
 181 
 182 nashorn.option.lazy.compilation = {                                                                      \
 183     name="--lazy-compilation",                                                                           \
 184     is_undocumented=true,                                                                                \
 185     desc="EXPERIMENTAL: Use lazy code generation strategies - do not compile the entire script at once." \
 186 }
 187 
 188 nashorn.option.loader.per.compile = {              \
 189     name="--loader-per-compile",                   \
 190     is_undocumented=true,                          \
 191     desc="Create a new class loader per compile.", \
 192     default=true                                   \
 193 }
 194 
 195 nashorn.option.no.syntax.extensions = {            \
 196     name="--no-syntax-extensions",                 \
 197     short_name="-nse",                             \
 198     is_undocumented=true,                          \
 199     desc="No non-standard syntax extensions",      \
 200     default=false                                  \
 201 }
 202 
 203 nashorn.option.package = {                                     \
 204     name="--package",                                          \
 205     is_undocumented=true,                                      \
 206     desc="Package to which generated .class files are added.", \
 207     params="<package>",                                        \
 208     type=String,                                               \
 209     default=""                                                 \
 210 }
 211 
 212 nashorn.option.parse.only = {       \
 213     name="--parse-only",            \
 214     is_undocumented=true,           \
 215     desc="Parse without compiling." \
 216 }
 217 
 218 nashorn.option.profile.callsites = {   \
 219     name="--profile-callsites",        \
 220     short_name="-pcs",                 \
 221     is_undocumented=true,              \
 222     desc="Dump callsite profile data." \
 223 }
 224 
 225 nashorn.option.print.ast = {            \
 226     name="--print-ast",                 \
 227     is_undocumented=true,               \
 228     desc="Print abstract syntax tree."  \
 229 }
 230 
 231 nashorn.option.print.lower.ast = {              \
 232     name="--print-lower-ast",                   \
 233     is_undocumented=true,                       \
 234     desc="Print lowered abstract syntax tree."  \
 235 }
 236 
 237 nashorn.option.print.code = { \
 238     name="--print-code",      \
 239     is_undocumented=true,     \
 240     desc="Print bytecode."    \
 241 }
 242 
 243 nashorn.option.print.mem.usage = {                            \
 244     name="--print-mem-usage",                                 \
 245     is_undocumented=true,                                     \
 246     desc="Print memory usage of IR after each compile stage." \
 247 }
 248 
 249 nashorn.option.print.no.newline = {                     \
 250     name="--print-no-newline",                          \
 251     is_undocumented=true,                               \
 252     desc="Print function will not print new line char." \
 253 }
 254 
 255 nashorn.option.print.parse = {   \
 256     name="--print-parse",        \
 257     is_undocumented=true,        \
 258     desc="Print the parse tree." \
 259 }
 260 
 261 nashorn.option.print.lower.parse = {            \
 262     name="--print-lower-parse",                 \
 263     is_undocumented=true,                       \
 264     desc="Print the parse tree after lowering." \
 265 }
 266 
 267 nashorn.option.print.symbols = {   \
 268     name="--print-symbols",        \
 269     is_undocumented=true,          \
 270     desc="Print the symbol table." \
 271 }
 272 
 273 nashorn.option.range.analysis = { \
 274     name="--range-analysis",      \
 275     is_undocumented=true,         \
 276     desc="Do range analysis using known compile time types, and try to narrow number types" \
 277 }    
 278 
 279 nashorn.option.D = {                                                          \
 280     name="-D",                                                                \
 281     desc="-Dname=value. Set a system property. This option can be repeated.", \
 282     type=String                                                               \
 283 }
 284 
 285 nashorn.option.strict = {              \
 286     name="-strict",                    \
 287     desc="Run scripts in strict mode." \
 288 }
 289 
 290 nashorn.option.scripting = {            \
 291     name="-scripting",                  \
 292     desc="Enable scripting features."   \
 293 }
 294 
 295 nashorn.option.specialize.calls = {                                                \
 296     name="--specialize-calls",                                                     \
 297     is_undocumented=true,                                                          \
 298     type=String,                                                                   \
 299     params="[=function_1,...,function_n]",                                         \
 300     desc="Specialize all or a set of method according to callsite parameter types" \
 301 }
 302 
 303 nashorn.option.stdout = {                                               \
 304     name="--stdout",                                                    \
 305     is_undocumented=true,                                               \
 306     type=String,                                                        \
 307     params="<output console>",                                          \
 308     desc="Redirect stdout to a filename or to another tty, e.g. stderr" \
 309 }
 310 
 311 nashorn.option.stderr = {                                               \
 312     name="--stderr",                                                    \
 313     is_undocumented=true,                                               \
 314     type=String,                                                        \
 315     params="<output console>",                                          \
 316     desc="Redirect stderr to a filename or to another tty, e.g. stdout" \
 317 }
 318 
 319 nashorn.option.timezone = {                    \
 320     name="-timezone",                          \
 321     short_name="-t",                           \
 322     params="<timezone>",                       \
 323     desc="Set timezone for script execution.", \
 324     type=TimeZone                              \
 325 }
 326 
 327 nashorn.option.locale = {                    \
 328     name="--locale",                         \
 329     short_name="-l",                         \
 330     is_undocumented=true,                    \
 331     params="<locale>",                       \
 332     desc="Set Locale for script execution.", \
 333     type=Locale                              \
 334 }
 335 
 336 nashorn.option.trace.callsites = {                                              \
 337     name="--trace-callsites",                                                   \
 338     short_name="-tcs",                                                          \
 339     is_undocumented=true,                                                       \
 340     type=keyvalues,                                                             \
 341     params="[=[option,]*]",                                                     \
 342     desc="Enable callsite trace mode. Options are: miss [trace callsite misses] \
 343     enterexit [trace callsite enter/exit], objects [print object properties]"   \
 344 }
 345 
 346 nashorn.option.verify.code = {              \
 347     name="--verify-code",                   \
 348     is_undocumented=true,                   \
 349     desc="Verify byte code before running." \
 350 }
 351 
 352 nashorn.option.version = {                \
 353     name="-version",                      \
 354     short_name="-v",                      \
 355     desc="Print version info of Nashorn." \
 356 }
 357