easyargs
easyargs copied to clipboard
subcommands are not required in Python 3
Using this example:
import easyargs
@easyargs
class Foo(object):
"""This is some help"""
def foo(self):
pass
def bar(self, baz):
pass
Foo()
Calling this from either Python 2.7 or 3.6 yields different results:
$ python2 example.py
usage: example.py [-h] {foo,bar} ...
example.py: error: too few arguments
$ python3 example.py
I think the output from Python 2.7 is the correct one. Supplying -h
as an argument works in both cases.