From dae57ff296a55b4e523fb38ec6cd00f7211e4fd5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 26 Jan 2011 06:20:32 +0100 Subject: [PATCH] =?utf8?q?Add=20=E2=80=9C--config-file=E2=80=9D=20paramete?= =?utf8?q?r=20to=20CLI.=20Fixes=20#65.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/de/todesbaum/jsite/main/CLI.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/de/todesbaum/jsite/main/CLI.java b/src/de/todesbaum/jsite/main/CLI.java index 3643599..668720b 100644 --- a/src/de/todesbaum/jsite/main/CLI.java +++ b/src/de/todesbaum/jsite/main/CLI.java @@ -69,6 +69,7 @@ public class CLI implements InsertListener { if ((args.length == 0) || args[0].equals("-h") || args[0].equals("--help")) { outputWriter.println("\nParameters:\n"); + outputWriter.println(" --config-file="); outputWriter.println(" --node="); outputWriter.println(" --project="); outputWriter.println(" --local-directory="); @@ -80,7 +81,15 @@ public class CLI implements InsertListener { return; } - Configuration configuration = new Configuration(); + String configFile = System.getProperty("user.home") + "/.jSite/config7"; + for (String argument : args) { + String value = argument.substring(argument.indexOf('=') + 1).trim(); + if (argument.startsWith("--config-file=")) { + configFile = value; + } + } + + Configuration configuration = new Configuration(configFile); if (!configuration.createLockFile()) { outputWriter.println("Lock file found!"); return; -- 2.7.4