From: Ralf Ertzinger Date: Fri, 21 Feb 2014 14:15:29 +0000 (+0100) Subject: Add --config/-c command line option to override config file location X-Git-Tag: 0.2.98.python3.1~27 X-Git-Url: https://git.camperquake.de/gitweb.cgi?p=time-slider.git;a=commitdiff_plain;h=bff9182e1ef4ed57de8d68f99af736ed37b5fcd8 Add --config/-c command line option to override config file location --- diff --git a/usr/share/time-slider/lib/time_slider/timesliderd.py b/usr/share/time-slider/lib/time_slider/timesliderd.py index dc669b6..99f802a 100755 --- a/usr/share/time-slider/lib/time_slider/timesliderd.py +++ b/usr/share/time-slider/lib/time_slider/timesliderd.py @@ -49,6 +49,8 @@ import plugin from time_slider.linux.rbac import RBACprofile import util +import time_slider.linux.timesliderconfig as timesliderconfig + _MINUTE = 60 _HOUR = _MINUTE * 60 _DAY = _HOUR * 24 @@ -931,8 +933,11 @@ def main(argv): parser = argparse.ArgumentParser() parser.add_argument('--foreground', action='store_true', help='Do not daemonize', default=False) + parser.add_argument('--config', '-c', type=str, help='Configuration file', default='/etc/time-slider/timesliderd.conf') args, _ = parser.parse_known_args() + timesliderconfig.configfile = args.config + # Daemonise the service. if not args.foreground: create_daemon()