Reworked what happens when no argument is provided.
Before a try...except block caught a TypeError when trying to call namespace.func (because namespace.func was None).
However, this will also catch type errors that can happen otherwise in the code.
Now: Explicitly check if namespace.func is None.
If it is, print the usage message instead of the help message.
Reworked what happens when no argument is provided.
Before a try...except block caught a TypeError when trying to call namespace.func (because namespace.func was None). However, this will also catch type errors that can happen otherwise in the code.
Now: Explicitly check if namespace.func is None. If it is, print the usage message instead of the help message.