diff options
author | jaseg <s@jaseg.de> | 2013-04-03 15:41:21 +0200 |
---|---|---|
committer | jaseg <s@jaseg.de> | 2013-04-03 15:41:21 +0200 |
commit | a41e8b36a184c67c941e349e0ce1af123c847bac (patch) | |
tree | e43c7bbf19a2a8d09793fa15eefbfcfa1e55f957 /ponysay.py | |
parent | cccea7324cd692e7926595d9c1a248602c027067 (diff) | |
download | ponysay-a41e8b36a184c67c941e349e0ce1af123c847bac.tar.gz ponysay-a41e8b36a184c67c941e349e0ce1af123c847bac.tar.bz2 ponysay-a41e8b36a184c67c941e349e0ce1af123c847bac.zip |
Fixed -* list args, bash completion, zsh balloon completion
Diffstat (limited to 'ponysay.py')
-rwxr-xr-x | ponysay.py | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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] |