File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed
graalpython/com.oracle.graal.python.shell/src/com/oracle/graal/python/shell Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -77,10 +77,10 @@ public static void main(String[] args) {
77
77
78
78
@ Override
79
79
protected List <String > preprocessArguments (List <String > givenArgs , Map <String , String > polyglotOptions ) {
80
- givenArguments = new ArrayList <>(givenArgs );
81
80
ArrayList <String > unrecognized = new ArrayList <>();
82
81
ArrayList <String > inputArgs = new ArrayList <>(getDefaultEnvironmentArgs ());
83
- inputArgs .addAll (givenArguments );
82
+ inputArgs .addAll (givenArgs );
83
+ givenArguments = new ArrayList <>(inputArgs );
84
84
List <String > arguments = new ArrayList <>(inputArgs );
85
85
List <String > subprocessArgs = new ArrayList <>();
86
86
programArgs = new ArrayList <>();
@@ -406,9 +406,15 @@ protected void launch(Builder contextBuilder) {
406
406
}
407
407
408
408
private void setContextOptionIfUnset (Builder contextBuilder , String key , String value ) {
409
- if (!givenArguments .contains ("--" + key ) && System .getProperty ("polyglot." + key ) == null ) {
410
- contextBuilder .option (key , value );
409
+ if (System .getProperty ("polyglot." + key ) != null ) {
410
+ return ;
411
+ }
412
+ for (String f : givenArguments ) {
413
+ if (f .startsWith ("--" + key )) {
414
+ return ;
415
+ }
411
416
}
417
+ contextBuilder .option (key , value );
412
418
}
413
419
414
420
private static void printFileNotFoundException (NoSuchFileException e ) {
You can’t perform that action at this time.
0 commit comments