diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-02-23 18:11:05 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-02-23 18:11:05 +0100 |
commit | 455485185e4a452bbafb7121054249f319f7eda9 (patch) | |
tree | 46f809b4329e02502bc5fbcdaf812ab819eb4861 | |
parent | fix errors in getting current curves + add getting curent curves to tests + fix multimonitor mistakes in examples (diff) | |
download | blueshift-455485185e4a452bbafb7121054249f319f7eda9.tar.gz blueshift-455485185e4a452bbafb7121054249f319f7eda9.tar.bz2 blueshift-455485185e4a452bbafb7121054249f319f7eda9.tar.xz |
add cmdline correctness test
Signed-off-by: Mattias Andrée <maandree@operamail.com>
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): |