From a41e8b36a184c67c941e349e0ce1af123c847bac Mon Sep 17 00:00:00 2001 From: jaseg Date: Wed, 3 Apr 2013 15:41:21 +0200 Subject: Fixed -* list args, bash completion, zsh balloon completion --- ponysay.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'ponysay.py') diff --git a/ponysay.py b/ponysay.py index 23239a5..6b68463 100755 --- a/ponysay.py +++ b/ponysay.py @@ -94,12 +94,13 @@ if __name__ == '__main__': parser.add_argument('-b', '--balloon', type=str, default='cowsay', help='Balloon style to use. Use "-b list" to list available styles.') parser.add_argument('text', type=str, nargs='*', help='The text to be placed in the speech bubble') args = parser.parse_args() - + + think = sys.argv[0].endswith('think') if args.pony == "list": - print('\n'.join(sorted(list_ponies(True)))) + print('\n'.join(sorted(list_ponies() if not args.quote else list_ponies_with_quotes()))) sys.exit() if args.balloon == 'list': - print('\n'.join(balloonstyles.keys())) + print('\n'.join([ s.replace('.think', '') for s in balloonstyles.keys() if s.endswith('.think') == think ])) sys.exit() pony = args.pony if pony == "random": @@ -111,7 +112,7 @@ if __name__ == '__main__': text = random_quote(pony) balloonstyle = None - if sys.argv[0].endswith('think'): + if think: balloonstyle = balloonstyles[args.balloon+'.think'] else: balloonstyle = balloonstyles[args.balloon] -- cgit