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

How do we print better usage messages?

Open nodox opened this issue 8 years ago • 8 comments

I'm not fond of all the extra information that prints when I want help on how to use a command. I find it distracts the user and almost looks like errors. Not sure how to override this behavior from my project myself. Only way I see right now is too fork and modify. Any ideas on how to get better usage messages?

Type:        function
String form: <function new at 0x0000000>
File:        playground
Line:        62
Docstring:   Creates a new playground stack

Usage:       playground new NAME
             playground new --name NAME

nodox avatar May 10 '18 20:05 nodox

There is not currently a supported way to modify this. As a hack, you could monkey-patch fire.helputils.HelpString and/or fire.helputils.UsageString. Caution though, since this could break down the line.

Also, Fire has a new contributor working on improving precisely this. So, improvements are coming.

dbieber avatar May 17 '18 20:05 dbieber

any updates about this request?

xheisenbugx avatar Jul 12 '18 20:07 xheisenbugx

Thanks for your interest.

Conceptually the improvements will come in two main parts:

  • part 1 is improving the default displayed information (removing the clutter, pushing all that excess information into --verbose output, improving the usage output, etc)
  • part 2 is about improving configurability

I'm meeting with @joejoevictor on July 25 to discuss the design for part 1. The current plan is that he'll be owning the "part 1" set of improvements. Part 2 discussions are still early (#98).

dbieber avatar Jul 13 '18 11:07 dbieber

Part 1 is still a work in progress, and we are actively (but slowly) working toward it.

dbieber avatar Dec 14 '18 22:12 dbieber

FWIW, usage is one of the things I noticed when comparing Fire with Click and Plumbum. I did make a few other observations about Fire along the way:

  • error messages for invalid types are not user-friendly
  • custom types for flexible file processing are available in Click (and argparse)

metaperl avatar Dec 28 '18 16:12 metaperl

@dbieber Any update on this? And also can we customize the help message i.e I want to display help message which has the information ,like what the command does.

Scsourav18 avatar Feb 12 '19 08:02 Scsourav18

Same as Dec 14, unfortunately: still a work in progress, and we are actively (but slowly) working toward it. The reason for the slowness is we typically only work on Fire for a short period once a week. But the improvements are coming!, just not quickly. You can see progress so far on master.

dbieber avatar Feb 26 '19 19:02 dbieber

This is waaay better now, and the release is going out on Friday (in two days.)

dbieber avatar Jul 24 '19 18:07 dbieber