Added -C command line flag for specifying configuration file location.
This commit is contained in:
parent
47b0f801fd
commit
d23cabf8f6
@ -77,8 +77,16 @@ def run():
|
|||||||
"-D", "--debug", action="store_true",
|
"-D", "--debug", action="store_true",
|
||||||
default=config.getboolean("logging", "debug"),
|
default=config.getboolean("logging", "debug"),
|
||||||
help="print debug information")
|
help="print debug information")
|
||||||
|
parser.add_option(
|
||||||
|
"-C", "--config",default='',
|
||||||
|
help='use a specific configuration file')
|
||||||
|
|
||||||
options = parser.parse_args()[0]
|
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
|
# Update Radicale configuration according to options
|
||||||
for option in parser.option_list:
|
for option in parser.option_list:
|
||||||
key = option.dest
|
key = option.dest
|
||||||
|
Loading…
Reference in New Issue
Block a user