python-fire
python-fire copied to clipboard
Is there any way to add command description in `-- --help`
I want to show some description of cmd when user typed in cmd -- --help.
The description is taken from the doc strings of the cmd object (i.e. module, class, function).
I cannot seem to get module docstrings represented in --help
I seem to have the same issue: the output from --help is not showing the available commands of my class...
turns out it was a defail in the way I was launching, the correct way is fire.Fire(myClass()) and I was doing it like fire.Fire(myClass) that is without the ()
The behavior does depend on whether or not the Class is instantiated, but I don't see that there is a way to get both the commands (methods) and flags (arguments) to show up.
- If the class is not instantiated the flags show up in
--helpbut not the commands. - If the class is instantiated, the commands show up but not the flags.