List of usage examples for jdk.nashorn.internal.runtime ScriptEnvironment getArguments
public List<String> getArguments()
From source file:z.zee.Z.java
License:Open Source License
/** * Run method logic.// ww w .j ava 2s.c o m * * @param in input stream for Z * @param out output stream for Z * @param err error stream for Z * @param args arguments to Z * * @return exit code * * @throws IOException if there's a problem setting up the streams */ protected final int run(final InputStream in, final OutputStream out, final OutputStream err, final String[] args) throws IOException { final Context context = makeContext(in, out, err, args); if (context == null) { return COMMANDLINE_ERROR; } final ScriptObject global = context.createGlobal(); final ScriptEnvironment env = context.getEnv(); final List<String> files = env.getFiles(); if (env.getArguments().isEmpty() && !scripting) { context.getErr().println(bundle.getString("shell.usage")); return COMPILATION_ERROR; } if (files.isEmpty()) { return readEvalPrint(context, global); } if (env._compile_only) { return compileScripts(context, global, files); } return runScripts(context, global, files); }