From: David ‘Bombe’ Roden Date: Wed, 26 Jan 2011 05:20:32 +0000 (+0100) Subject: Add “--config-file” parameter to CLI. Fixes #65. X-Git-Tag: 0.10-rc1~78 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=dae57ff296a55b4e523fb38ec6cd00f7211e4fd5;p=jSite.git Add “--config-file” parameter to CLI. Fixes #65. --- 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;