diff options
Diffstat (limited to '')
-rw-r--r-- | TODO | 1 | ||||
-rwxr-xr-x | src/__main__.py | 14 |
2 files changed, 14 insertions, 1 deletions
@@ -2,7 +2,6 @@ Medium priority: Small examples -r support in the comperhensive example Store settings so that we can transition from them instead of from clean - Verify command line option correctness Low priority: Fix errors caused by SIGUSR2 diff --git a/src/__main__.py b/src/__main__.py index f189e16..d4c9d4d 100755 --- a/src/__main__.py +++ b/src/__main__.py @@ -356,6 +356,20 @@ output = parser.opts['--output'] if output is None: output = [] +if config_file is not None: + if any([doreset, location, gammas, rgb_brightnesses, cie_brightnesses, temperatures, output]): + print('--configurations can only be combined with --panicgate') + sys.exit(1) + +a = lambda opt : 0 if parser.opts[opt] is None else len(parser.opts[opt]) +for opt in ('--configurations', '--panicgate', '--reset', '--location'): + if a(opt) > 1: + print('%s can only be used once' % opt) + sys.exit(1) +for opt in ('--gamma', '--brightness', '++brightness', '--temperature'): + if a(opt) > 2: + print('%s can only be used up to two times' % opt) + sys.exit(1) settings = [gammas, rgb_brightnesses, cie_brightnesses, temperatures] if (config_file is None) and any([doreset, location] + settings): |