From 87bdaa88cd286661ab65c46216c3ce6cd33052f9 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Tue, 8 Apr 2014 12:11:08 +0200 Subject: [PATCH] Parse --curdir in Base.main() This shouldn't change any behaviour, but prepares for upcoming changes. --- app/src/processing/app/Base.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index 92b417713..23d72f0d3 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -117,6 +117,10 @@ public class Base { // Location for untitled items static File untitledFolder; + // Current directory to use for relative paths specified on the + // commandline + static String currentDirectory = System.getProperty("user.dir"); + // p5 icon for the window // static Image icon; @@ -150,6 +154,12 @@ public class Base { if (args[i].equals("--preferences-file")) { ++i; preferencesFile = new File(args[i]); + continue; + } + if (args[i].equals("--curdir")) { + i++; + currentDirectory = args[i]; + continue; } } @@ -339,7 +349,6 @@ public class Base { String getPref = null; String selectBoard = null; String selectPort = null; - String currentDirectory = System.getProperty("user.dir"); List filenames = new LinkedList(); // Map of possible actions and corresponding options @@ -398,7 +407,7 @@ public class Base { i++; if (i >= args.length) showError(null, _("Argument required for --curdir"), 3); - currentDirectory = args[i]; + // Argument should be already processed by Base.main(...) continue; } if (args[i].equals("--pref")) {