mirror of
https://github.com/erkin/ponysay.git
synced 2025-01-31 10:26:43 +01:00
display help if no arguments and not piped
This commit is contained in:
parent
5dde586850
commit
24eb3cbcf6
1 changed files with 4 additions and 4 deletions
|
@ -97,6 +97,10 @@ class Ponysay():
|
||||||
Starts the part of the program the arguments indicate
|
Starts the part of the program the arguments indicate
|
||||||
'''
|
'''
|
||||||
def __init__(self, args):
|
def __init__(self, args):
|
||||||
|
if (args.argcount == 0) and not pipelinein:
|
||||||
|
args.help()
|
||||||
|
return
|
||||||
|
|
||||||
if (args.opts['-l'] is not None) and pipelineout:
|
if (args.opts['-l'] is not None) and pipelineout:
|
||||||
args.opts['--onelist'] = args.opts['-l']
|
args.opts['--onelist'] = args.opts['-l']
|
||||||
args.opts['-l'] = None
|
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.add_variadic( ['-q', '--quote'], arg = "PONY", help = 'Select a ponies which will quote themself.')
|
||||||
|
|
||||||
opts.parse()
|
opts.parse()
|
||||||
# TODO implement if [ -t 0 ] && [ $# == 0 ]; then
|
|
||||||
# usage
|
|
||||||
# exit
|
|
||||||
# fi
|
|
||||||
|
|
||||||
|
|
||||||
'''
|
'''
|
||||||
|
|
Loading…
Reference in a new issue