Skip to content

Commit aa28fe1

Browse files
committed
[GR-23265] Consume -X CLI options
PullRequest: graalpython/1063
2 parents 6ebd657 + ce97f54 commit aa28fe1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell/GraalPythonMain.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,15 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
153153
case "-S":
154154
noSite = true;
155155
break;
156+
case "-X":
157+
i++;
158+
if (i < arguments.size()) {
159+
// CPython ignores unknown/unsupported -X options, so we can do that too
160+
} else {
161+
print("Argument expected for the -X option");
162+
printShortHelp();
163+
}
164+
break;
156165
case "-v":
157166
verboseFlag = true;
158167
break;
@@ -585,6 +594,7 @@ protected void printHelp(OptionCategory maxCategory) {
585594
" can be supplied multiple times to increase verbosity\n" +
586595
"-V : print the Python version number and exit (also --version)\n" +
587596
" when given twice, print more information about the build\n" +
597+
"-X opt : CPython implementation-specific options. Ignored on GraalPython\n" +
588598
// "-W arg : warning control; arg is
589599
// action:message:category:module:lineno\n" +
590600
// " also PYTHONWARNINGS=arg\n" +

0 commit comments

Comments
 (0)