From d23cabf8f6151b4a718cad271de3c4901e5a7be0 Mon Sep 17 00:00:00 2001 From: Mark Adams Date: Tue, 15 Jan 2013 13:12:34 -0600 Subject: [PATCH] Added -C command line flag for specifying configuration file location. --- radicale/__main__.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/radicale/__main__.py b/radicale/__main__.py index b72db77..9f4b986 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -77,8 +77,16 @@ def run(): "-D", "--debug", action="store_true", default=config.getboolean("logging", "debug"), help="print debug information") - options = parser.parse_args()[0] + parser.add_option( + "-C", "--config",default='', + help='use a specific configuration file') + options = parser.parse_args()[0] + + # Read in the configuration specified by the command line (if specified) + if options.config != '': + config.read(options.config) + # Update Radicale configuration according to options for option in parser.option_list: key = option.dest @@ -86,7 +94,7 @@ def run(): section = "logging" if key == "debug" else "server" value = getattr(options, key) config.set(section, key, str(value)) - + # Start logging log.start()