Skip to content

Commit

Permalink
[GR-2798] Fix help and other polyglot options.
Browse files Browse the repository at this point in the history
PullRequest: fastr/1475
  • Loading branch information
steve-s committed Apr 12, 2018
2 parents db2802b + 1b2a0dd commit 634088e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
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 {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ private enum RCmdOptionType {
}

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"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.util.List;
import java.util.Map;

import org.graalvm.options.OptionCategory;
import org.graalvm.polyglot.PolyglotException;
import org.graalvm.polyglot.Source;

Expand All @@ -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);
}
}

Expand Down

0 comments on commit 634088e

Please sign in to comment.