Closed Bug 798851 Opened 12 years ago Closed 12 years ago

Improve sutcli usage formatting

Categories

(Testing :: Mozbase, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mcote, Unassigned)

Details

Attachments

(1 file)

To build on bug 797575, it would be fairly easy to use the textwrap module to nicely wrap the usage text.
In addition to using textwrap, I did a few other little changes in here, namely
* moving the initial declaration of 'usage' to after we define the commands, to keep it near where we define the command usage
* removed temp variable 'help_args', which is only used in one place
* shortened loop variable names to save space
* removed the " ".join() between commandname and command['help_args'] and just inserted a space into the main string, since both are always simple strings
* used a list comprehension. I don't actually think this is any more readable, nor am I doing it for cool factor, but it is the most concise way to prevent a trailing newline. I think it looks funny to have two blank lines between the usage and error message.

Lemme know if you don't agree with any of those changes.
Attachment #668875 - Flags: review?(wlachance)
Comment on attachment 668875 [details] [diff] [review]
Improve sutcli usage formatting

Review of attachment 668875 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great! Thanks.

Eventually I'd like to switch to a more sophisticated parser for the command line stuff (e.g. http://apenwarr.ca/log/?m=201111), but this is a nice incremental improvement.
Attachment #668875 - Flags: review?(wlachance) → review+
https://github.com/mozilla/mozbase/commit/c422c2155674ee56f2eae0d17a1545935e20efb6
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: