Closed bskinn closed 2 years ago
~More idiomatic that way, and should provide a sensible argparse failed exit for things like sphobjinv --foo, instead of a mysterious exception deeper in the CLI code.~
argparse
sphobjinv --foo
~Annoying I had to monkeypatch argparse._VersionAction.__call__() to have the newlines not get swallowed up, but what can you do?~
argparse._VersionAction.__call__()
While argparse is not likely to change much over time, the above approach (see (tag)[https://github.com/bskinn/sphobjinv/tree/wontfix-required-subparser]) just really seemed too brittle.
Much better just to trap for a null subparser in the CLI code and cleanly error-exit.
~More idiomatic that way, and should provide a sensible
argparse
failed exit for things likesphobjinv --foo
, instead of a mysterious exception deeper in the CLI code.~~Annoying I had to monkeypatch
argparse._VersionAction.__call__()
to have the newlines not get swallowed up, but what can you do?~While
argparse
is not likely to change much over time, the above approach (see (tag)[https://github.com/bskinn/sphobjinv/tree/wontfix-required-subparser]) just really seemed too brittle.Much better just to trap for a null subparser in the CLI code and cleanly error-exit.