python-fire icon indicating copy to clipboard operation
python-fire copied to clipboard

Is there any way to add command description in `-- --help`

Open joon612 opened this issue 3 years ago • 5 comments

I want to show some description of cmd when user typed in cmd -- --help.

joon612 avatar Oct 31 '22 03:10 joon612

The description is taken from the doc strings of the cmd object (i.e. module, class, function).

mwort avatar Nov 17 '22 14:11 mwort

I cannot seem to get module docstrings represented in --help

gaardhus avatar Nov 24 '22 16:11 gaardhus

I seem to have the same issue: the output from --help is not showing the available commands of my class...

siran avatar Jan 22 '23 02:01 siran

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 ()

siran avatar Jan 22 '23 14:01 siran

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 --help but not the commands.
  • If the class is instantiated, the commands show up but not the flags.

klaerik avatar Aug 08 '23 23:08 klaerik