Skip to content
Snippets Groups Projects
Commit 51e7b1b2 authored by stepan's avatar stepan
Browse files

Launcher fix: let the polyglot options to be processed by the polyglot launcher

parent db2802b1
No related branches found
No related tags found
No related merge requests found
......@@ -64,7 +64,6 @@ public final class RCmdOptions {
}
public enum RCmdOption {
HELP(RCmdOptionType.BOOLEAN, true, "h", "help", false, "Print short help message and exit"),
VERSION(RCmdOptionType.BOOLEAN, true, "version", false, "Print version info and exit"),
ENCODING(RCmdOptionType.STRING, false, "encoding=ENC", null, "Specify encoding to be used for stdin"),
SAVE(RCmdOptionType.BOOLEAN, true, "save", false, "Do save workspace at the end of the session"),
......
......@@ -31,6 +31,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.graalvm.options.OptionCategory;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.Source;
......@@ -52,13 +53,11 @@ public final class RscriptCommand extends RAbstractLauncher {
}
@Override
protected List<String> preprocessArguments(List<String> arguments, Map<String, String> polyglotOptions) {
List<String> unrecognizedArgs = super.preprocessArguments(arguments, polyglotOptions);
protected void validateArguments(Map<String, String> polyglotOptions) {
try {
this.rScriptArguments = preprocessRScriptOptions(options);
return unrecognizedArgs;
} catch (PrintHelp e) {
return Collections.singletonList("--help");
printHelp(OptionCategory.USER);
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment