File tree Expand file tree Collapse file tree 2 files changed +34
-7
lines changed
core/src/main/java/org/jruby/util/cli Expand file tree Collapse file tree 2 files changed +34
-7
lines changed Original file line number Diff line number Diff line change 39
39
import java .io .File ;
40
40
import java .io .FileNotFoundException ;
41
41
import java .io .IOException ;
42
- import java .util .ArrayList ;
43
- import java .util .Arrays ;
44
- import java .util .List ;
42
+ import java .util .*;
45
43
46
44
/**
47
45
* Encapsulated logic for processing JRuby's command-line arguments.
@@ -94,6 +92,8 @@ public void processArguments() {
94
92
}
95
93
96
94
public void processArguments (boolean inline ) {
95
+ checkProperties ();
96
+
97
97
while (argumentIndex < arguments .size () && isInterpreterArgument (arguments .get (argumentIndex ).originalValue )) {
98
98
processArgument ();
99
99
argumentIndex ++;
@@ -679,4 +679,24 @@ public static void checkGraalVersion() {
679
679
}
680
680
}
681
681
682
+ private void checkProperties () {
683
+ final Set <String > propertyNames = new HashSet <>();
684
+ propertyNames .addAll (Options .getPropertyNames ());
685
+ propertyNames .add ("jruby.home" );
686
+ propertyNames .add ("jruby.script" );
687
+ propertyNames .add ("jruby.shell" );
688
+ propertyNames .add ("jruby.lib" );
689
+ propertyNames .add ("jruby.bindir" );
690
+ propertyNames .add ("jruby.jar" );
691
+ propertyNames .add ("jruby.compat.version" );
692
+
693
+ for (String propertyName : System .getProperties ().stringPropertyNames ()) {
694
+ if (propertyName .startsWith ("jruby." )) {
695
+ if (!propertyNames .contains (propertyName )) {
696
+ System .err .println ("jruby: warning: unknown property " + propertyName );
697
+ }
698
+ }
699
+ }
700
+ }
701
+
682
702
}
Original file line number Diff line number Diff line change 28
28
***** END LICENSE BLOCK *****/
29
29
package org .jruby .util .cli ;
30
30
31
- import java .util .ArrayList ;
32
- import java .util .Collection ;
33
- import java .util .Collections ;
34
- import java .util .List ;
31
+ import java .util .*;
35
32
36
33
import com .headius .options .Option ;
37
34
import org .jruby .TruffleBridge ;
@@ -338,4 +335,14 @@ private static void list(SearchMode mode, String string) {
338
335
}
339
336
}
340
337
338
+ public static Set <String > getPropertyNames () {
339
+ final Set <String > propertyNames = new HashSet <String >();
340
+
341
+ for (Option option : PROPERTIES ) {
342
+ propertyNames .add (option .propertyName ());
343
+ }
344
+
345
+ return Collections .unmodifiableSet (propertyNames );
346
+ }
347
+
341
348
}
You can’t perform that action at this time.
0 commit comments