From 36a2db2e70e94ab481f2050ce3364d626a5ee453 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= <maandree@operamail.com>
Date: Tue, 1 Jan 2013 00:11:18 +0100
Subject: [PATCH] unfreeze: ponysay-tool --edit
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Mattias Andrée <maandree@operamail.com>
---
 ponysay.py | 24 +++++++++++++++++-------
 1 file changed, 17 insertions(+), 7 deletions(-)

diff --git a/ponysay.py b/ponysay.py
index 41e2ab71..1287ce81 100755
--- a/ponysay.py
+++ b/ponysay.py
@@ -303,13 +303,23 @@ class Ponysay():
         self.extraponydirs = self.extravtponydirs if self.linuxvt and not self.usekms else self.extraxponydirs
         
         ## Variadic variants of -f, -q &c
-        for sign in ('-', '+'):
-            for letter in ('f', 'F', 'q', 'Q'):
-                ssl = sign + sign + letter
-                sl = sign + letter
-                if (ssl in args.opts) and (args.opts[ssl] is not None):
-                    if args.opts[sl] is not None:  args.opts[sl] += args.opts[ssl]
-                    else:                          args.opts[sl]  = args.opts[ssl]
+        if    args.opts['--f'] is not None:
+            if args.opts['-f'] is not None:  args.opts['-f'] += args.opts['--f']
+            else:                            args.opts['-f']  = args.opts['--f']
+        if    args.opts['++f'] is not None:
+            if args.opts['+f'] is not None:  args.opts['+f'] += args.opts['++f']
+            else:                            args.opts['+f']  = args.opts['++f']
+        if    args.opts['--q'] is not None:
+            if args.opts['-q'] is not None:  args.opts['-q'] += args.opts['--q']
+            else:                            args.opts['-q']  = args.opts['--q']
+        # FIXME the following is how it should be done, but it freezes the program
+        #for sign in ('-', '+'):
+        #    for letter in ('f', 'F', 'q', 'Q'):
+        #        ssl = sign + sign + letter
+        #        sl = sign + letter
+        #        if (ssl in args.opts) and (args.opts[ssl] is not None):
+        #            if args.opts[sl] is not None:  args.opts[sl] += args.opts[ssl]
+        #            else:                          args.opts[sl]  = args.opts[ssl]
         
         ## Run modes
         if   args.opts['-h']        is not None:  args.help()