diff options
author | Mattias Andrée <maandree@operamail.com> | 2012-08-19 19:41:16 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2012-08-19 19:41:16 +0200 |
commit | 24eb3cbcf68e1ed034432d107aa6519386a99307 (patch) | |
tree | 368d37a9567f340801787137ae8822d41e097e35 | |
parent | 5dde58685012ffaa5e280e025b088a0dd3395ddc (diff) | |
download | ponysay-24eb3cbcf68e1ed034432d107aa6519386a99307.tar.gz ponysay-24eb3cbcf68e1ed034432d107aa6519386a99307.tar.bz2 ponysay-24eb3cbcf68e1ed034432d107aa6519386a99307.zip |
display help if no arguments and not piped
-rwxr-xr-x | ponysay.py | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -97,6 +97,10 @@ class Ponysay(): Starts the part of the program the arguments indicate ''' def __init__(self, args): + if (args.argcount == 0) and not pipelinein: + args.help() + return + if (args.opts['-l'] is not None) and pipelineout: args.opts['--onelist'] = args.opts['-l'] args.opts['-l'] = None @@ -778,10 +782,6 @@ opts.add_argumented( ['-f', '--pony'], arg = "PONY", help = 'Select a po opts.add_variadic( ['-q', '--quote'], arg = "PONY", help = 'Select a ponies which will quote themself.') opts.parse() -# TODO implement if [ -t 0 ] && [ $# == 0 ]; then -# usage -# exit -# fi ''' |