@@ -90,7 +90,6 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
90
90
String arg = arguments .get (i );
91
91
switch (arg ) {
92
92
case "-B" :
93
- System .out .println ("Warning: " + arg + " does nothing on GraalPython." );
94
93
break ;
95
94
case "-c" :
96
95
i += 1 ;
@@ -123,7 +122,7 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
123
122
break ;
124
123
case "-O" :
125
124
case "-OO" :
126
- System . out . println ( "Warning: " + arg + " does nothing on GraalPython." );
125
+ case "-R" :
127
126
break ;
128
127
case "-q" :
129
128
quietFlag = true ;
@@ -192,7 +191,13 @@ protected List<String> preprocessArguments(List<String> givenArgs, Map<String, S
192
191
inputFile = arg ;
193
192
programArgs .add (inputFile );
194
193
break ;
194
+ } else if (!arg .startsWith ("--" ) && arg .length () > 2 ) {
195
+ // short arguments can be given together
196
+ for (String optionChar : arg .substring (1 ).split ("" )) {
197
+ arguments .add (i + 1 , "-" + optionChar );
198
+ }
195
199
} else {
200
+ // possibly a polyglot argument
196
201
unrecognized .add (arg );
197
202
}
198
203
}
@@ -494,20 +499,23 @@ protected String getLanguageId() {
494
499
protected void printHelp (OptionCategory maxCategory ) {
495
500
print ("usage: python [option] ... (-c cmd | file) [arg] ...\n " +
496
501
"Options and arguments (and corresponding environment variables):\n " +
497
- "-B : don't write .py[co] files on import; also PYTHONDONTWRITEBYTECODE=x\n " +
502
+ "-B : on CPython, this disables writing .py[co] files on import;\n " +
503
+ " GraalPython does not use bytecode, and thus this flag has no effect\n " +
498
504
"-c cmd : program passed in as string (terminates option list)\n " +
499
505
// "-d : debug output from parser; also PYTHONDEBUG=x\n" +
500
506
"-E : ignore PYTHON* environment variables (such as PYTHONPATH)\n " +
501
507
"-h : print this help message and exit (also --help)\n " +
502
508
"-i : inspect interactively after running script; forces a prompt even\n " +
503
509
" if stdin does not appear to be a terminal; also PYTHONINSPECT=x\n " +
504
510
"-m mod : run library module as a script (terminates option list)\n " +
505
- "-O : optimize generated bytecode slightly; also PYTHONOPTIMIZE=x\n " +
506
- "-OO : remove doc-strings in addition to the -O optimizations\n " +
507
- // "-R : use a pseudo-random salt to make hash() values of various types
508
- // be\n" +
509
- // " unpredictable between separate invocations of the interpreter, as\n" +
510
- // " a defense against denial-of-service attacks\n" +
511
+ "-O : on CPython, this optimizes generated bytecode slightly;\n " +
512
+ " GraalPython does not use bytecode, and thus this flag has no effect\n " +
513
+ "-OO : remove doc-strings in addition to the -O optimizations;\n " +
514
+ " GraalPython does not use bytecode, and thus this flag has no effect\n " +
515
+ "-R : on CPython, this enables the use of a pseudo-random salt to make\n " +
516
+ " hash()values of various types be unpredictable between separate\n " +
517
+ " invocations of the interpreter, as a defense against denial-of-service\n " +
518
+ " attacks; GraalPython always enables this and the flag has no effect.\n " +
511
519
// "-Q arg : division options: -Qold (default), -Qwarn, -Qwarnall, -Qnew\n"
512
520
// +
513
521
"-q : don't print version and copyright messages on interactive startup\n " +
0 commit comments