@@ -117,6 +117,10 @@ public class Base {
117
117
// Location for untitled items
118
118
static File untitledFolder ;
119
119
120
+ // Current directory to use for relative paths specified on the
121
+ // commandline
122
+ static String currentDirectory = System .getProperty ("user.dir" );
123
+
120
124
// p5 icon for the window
121
125
// static Image icon;
122
126
@@ -150,6 +154,12 @@ static public void main(String args[]) throws Exception {
150
154
if (args [i ].equals ("--preferences-file" )) {
151
155
++i ;
152
156
preferencesFile = new File (args [i ]);
157
+ continue ;
158
+ }
159
+ if (args [i ].equals ("--curdir" )) {
160
+ i ++;
161
+ currentDirectory = args [i ];
162
+ continue ;
153
163
}
154
164
}
155
165
@@ -339,7 +349,6 @@ public Base(String[] args) throws Exception {
339
349
String getPref = null ;
340
350
String selectBoard = null ;
341
351
String selectPort = null ;
342
- String currentDirectory = System .getProperty ("user.dir" );
343
352
List <String > filenames = new LinkedList <String >();
344
353
345
354
// Map of possible actions and corresponding options
@@ -398,7 +407,7 @@ public Base(String[] args) throws Exception {
398
407
i ++;
399
408
if (i >= args .length )
400
409
showError (null , _ ("Argument required for --curdir" ), 3 );
401
- currentDirectory = args [ i ];
410
+ // Argument should be already processed by Base.main(...)
402
411
continue ;
403
412
}
404
413
if (args [i ].equals ("--pref" )) {
0 commit comments