$ python3-pip-skeleton
Traceback (most recent call last):
File "/home/eyh46967/dev/python3-pip-skeleton-cli/venv/bin/python3-pip-skeleton", line 8, in <module>
sys.exit(main())
File "/home/eyh46967/dev/python3-pip-skeleton-cli/src/python3_pip_skeleton/__main__.py", line 264, in main
args.func(args)
AttributeError: 'Namespace' object has no attribute 'func'
This error is unhelpful. I would expect the help message to be displayed if no arguments are given.
I personally solved this recently with the following extended ArgumentParser:
class CustomParser(ArgumentParser):
def error(self, message):
# Without this, calling the module with no command line arguments
# only prints an error message, not the help or usage
sys.stderr.write("error: %s\n" % message)
self.print_help()
sys.exit(2)
parser = CustomParser(prog="github_members")
but I'm sure there are many ways to solve this.