google / python-fire

Python Fire is a library for automatically generating command line interfaces (CLIs) from absolutely any Python object.
Other
26.95k stars 1.44k forks source link

Verbose help message on objects when possible: No flags and --help flag consistent behavior #504

Open ESPR3SS0 opened 6 months ago

ESPR3SS0 commented 6 months ago

Issue: Fixes https://github.com/google/python-fire/issues/438

Given an object that has no init method, or the init method takes no arguments besides self passing a '--help' flag results in a less verbose help message than if no flag was passed at all.

Cause:

Fix: A check to see if the object contains an init method, and whether or not the init method requires arguments fixes this. If no arguments are required, instantiate an object then show the help message.