aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-04-11 11:45:24 +0200
committerMattias Andrée <maandree@operamail.com>2014-04-11 11:45:24 +0200
commit26b4dfb6aa845ded26917b812cfdffa3c47c2638 (patch)
tree427054078beb78fe234aa88561c4dd297c1c6a1f
parentparse all -l -m arguments (diff)
downloadnightshift-26b4dfb6aa845ded26917b812cfdffa3c47c2638.tar.gz
nightshift-26b4dfb6aa845ded26917b812cfdffa3c47c2638.tar.bz2
nightshift-26b4dfb6aa845ded26917b812cfdffa3c47c2638.tar.xz
Translate single-parameter -t into dual-parameter -t
Signed-off-by: Mattias Andrée <maandree@operamail.com>
-rwxr-xr-xsrc/nightshift.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/nightshift.py b/src/nightshift.py
index bda864b..24fc48c 100755
--- a/src/nightshift.py
+++ b/src/nightshift.py
@@ -233,6 +233,14 @@ for opt in ('-l', '-m'):
proc = Popen(proc, stdout = sys.stdout, stderr = sys.stderr)
proc.wait()
sys.exit(proc.returncode)
+# Translate single-parameter -t into dual-parameter -t
+i = 0
+while '-t' in red_opts[i:]:
+ i = red_opts.index('-t') + 1
+ if not i == len(red_opts):
+ if ':' not in red_opts[i]:
+ red_opts[i] = '%s:%s' % (red_opts[i], red_opts[i])
+
# Construct name of socket