Skip to content
Snippets Groups Projects
Commit 634088e4 authored by Stepan Sindelar's avatar Stepan Sindelar
Browse files

[GR-2798] Fix help and other polyglot options.

PullRequest: fastr/1475
parents db2802b1 1b2a0dd0
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,7 @@ import com.oracle.truffle.r.runtime.env.RScope;
import com.oracle.truffle.r.runtime.ffi.RFFIFactory;
import com.oracle.truffle.r.runtime.nodes.RBaseNode;
@TruffleLanguage.Registration(name = "R", id = "R", version = "3.3.2", mimeType = {RRuntime.R_APP_MIME, RRuntime.R_TEXT_MIME}, interactive = true)
@TruffleLanguage.Registration(name = "R", id = "R", version = "3.4.0", mimeType = {RRuntime.R_APP_MIME, RRuntime.R_TEXT_MIME}, interactive = true)
@ProvidedTags({StandardTags.CallTag.class, StandardTags.StatementTag.class, StandardTags.RootTag.class, RSyntaxTags.LoopTag.class, FunctionBodyBlockTag.class})
public final class TruffleRLanguageImpl extends TruffleRLanguage {
......
......@@ -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