mirror of
https://github.com/erkin/ponysay.git
synced 2025-02-07 21:46:42 +01:00
unfreeze: ponysay-tool --edit
Signed-off-by: Mattias Andrée <maandree@operamail.com>
This commit is contained in:
parent
7abae8a796
commit
36a2db2e70
1 changed files with 17 additions and 7 deletions
24
ponysay.py
24
ponysay.py
|
@ -303,13 +303,23 @@ class Ponysay():
|
||||||
self.extraponydirs = self.extravtponydirs if self.linuxvt and not self.usekms else self.extraxponydirs
|
self.extraponydirs = self.extravtponydirs if self.linuxvt and not self.usekms else self.extraxponydirs
|
||||||
|
|
||||||
## Variadic variants of -f, -q &c
|
## Variadic variants of -f, -q &c
|
||||||
for sign in ('-', '+'):
|
if args.opts['--f'] is not None:
|
||||||
for letter in ('f', 'F', 'q', 'Q'):
|
if args.opts['-f'] is not None: args.opts['-f'] += args.opts['--f']
|
||||||
ssl = sign + sign + letter
|
else: args.opts['-f'] = args.opts['--f']
|
||||||
sl = sign + letter
|
if args.opts['++f'] is not None:
|
||||||
if (ssl in args.opts) and (args.opts[ssl] is not None):
|
if args.opts['+f'] is not None: args.opts['+f'] += args.opts['++f']
|
||||||
if args.opts[sl] is not None: args.opts[sl] += args.opts[ssl]
|
else: args.opts['+f'] = args.opts['++f']
|
||||||
else: args.opts[sl] = args.opts[ssl]
|
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
|
## Run modes
|
||||||
if args.opts['-h'] is not None: args.help()
|
if args.opts['-h'] is not None: args.help()
|
||||||
|
|
Loading…
Reference in a new issue