You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2024. It is now read-only.
$ 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")