Last Comment Bug 458631 - Misalignment in --help command line
: Misalignment in --help command line
Status: RESOLVED FIXED
:
Product: Toolkit
Classification: Components
Component: Startup and Profile System (show other bugs)
: Trunk
: All Linux
-- trivial (vote)
: mozilla1.9.3a1
Assigned To: Romain BEZUT
:
: Benjamin Smedberg [:bsmedberg]
Mentors:
Depends on:
Blocks: 546296
  Show dependency treegraph
 
Reported: 2008-10-05 14:15 PDT by Romain BEZUT
Modified: 2010-02-15 07:28 PST (History)
5 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (with hg up to date) (575 bytes, patch)
2008-10-05 14:15 PDT, Romain BEZUT
no flags Details | Diff | Splinter Review
Correction on 2nd alignment (577 bytes, patch)
2008-10-05 16:44 PDT, Romain BEZUT
no flags Details | Diff | Splinter Review
Patch V3 (6.36 KB, patch)
2009-10-01 16:21 PDT, Romain BEZUT
gavin.sharp: review+
Details | Diff | Splinter Review

Description User image Romain BEZUT 2008-10-05 14:15:06 PDT
Created attachment 341846 [details] [diff] [review]
patch (with hg up to date)

When I type "myapp --help" or "myapp -h" (works with firefox too), I have something like that :

	-v or -version		Print Firefox version.
	-P <profile>		Start with <profile>.
	-ProfileManager		Start with ProfileManager.
	-no-remote		Open new instance, not a new window in running instance.
	-UILocale <locale>		Start with <locale> resources as UI Locale.
	-safe-mode		Disables extensions and themes for this session.
  -jsconsole           Open the Error console.

There is a misalignment with -jsconsole.

------------------

Patch tested and compiled with the last version of hg (about 15 minutes ago).
Worked successfully on Firefox (did not test with other apps).
Comment 1 User image Romain BEZUT 2008-10-05 16:44:35 PDT
Created attachment 341862 [details] [diff] [review]
Correction on 2nd alignment

Mmmh, a little mistake that I have not seen before on the 2nd alignment.
Sorry I am a bit tired tonight.
Comment 2 User image Philip Chee 2008-10-05 19:37:41 PDT
Hmm.
<http://mxr.mozilla.org/comm-central/search?string=helpInfo+%3A&find=&findi=&filter=%5E%5B%5E%5C0%5D*%24&hitlimit=&tree=comm-central>
None of the other javascript based command line handlers use tabs.

Which should the js error console handler be consistent with?
Comment 3 User image Philip Chee 2008-10-05 19:41:34 PDT
Isn't the display of \t highly dependent on both the OS environment and individual user settings?
Comment 4 User image Florian Quèze [:florian] [:flo] (PTO until February 27) 2008-10-05 22:45:36 PDT
(In reply to comment #3)
> Isn't the display of \t highly dependent on both the OS environment and
> individual user settings?

Probably, but IMHO that's why it would be better to display all the options with the same number of tabs or spaces.

The other help messages that are part of the toolkit are displayed with tabs, see:
http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsAppRunner.cpp#1174
Comment 5 User image Philip Chee 2008-10-06 03:12:56 PDT
> Probably, but IMHO that's why it would be better to display all the options
> with the same number of tabs or spaces.

I don't know what you see in comment 0, but none of the lines are aligned on the second column on my browser (not just the error console). Could I suggest that nsAppRunner.cpp be converted to spaces instead?
Comment 6 User image Romain BEZUT 2008-10-06 12:34:54 PDT
(In reply to comment #5)
> I don't know what you see in comment 0, but none of the lines are aligned on
> the second column on my browser (not just the error console). Could I suggest
> that nsAppRunner.cpp be converted to spaces instead?

Bugzilla does not render the correct alignment, all the options are aligned twice, except -jsconsole.

Change all tabulations by spaces in nsAppRunner.cpp can also be a good idea, but I prefer patching a single line in jsconsole-clhandler.js, than multiple lines (and check for alignment with spaces) in nsAppRunner.cpp.

In any case, we should harmonize that stuff.
Comment 7 User image Philip Chee 2008-10-06 13:39:03 PDT
> but I prefer patching a single line in jsconsole-clhandler.js
....
> In any case, we should harmonize that stuff.

In that case for consistency you should also patch all the other js command line handlers - in both mozilla-central and in comm-central.
Comment 8 User image :Gavin Sharp [email: gavin@gavinsharp.com] 2009-09-29 11:05:21 PDT
Comment on attachment 341862 [details] [diff] [review]
Correction on 2nd alignment

I think it probably makes more sense to convert nsAppRunner - every other component in the tree seems to use spaces.
Comment 9 User image Romain BEZUT 2009-10-01 16:21:20 PDT
Created attachment 404155 [details] [diff] [review]
Patch V3

This patch applies to Mozilla-Central.
- It fixes the behavior in nsAppRunner (replacing tabulations with spaces).
- And also fixed extra space(s) in -jsconsole, -browser, -private and -setDefaultBrowser.

If a patch for comm-central is needed please tell me.
Works with Hg updated at the time of this comment, tested on Firefox.
Comment 10 User image Marco Bonardo [::mak] 2009-10-09 03:52:22 PDT
http://hg.mozilla.org/mozilla-central/rev/a6a223195bf2

Note You need to log in before you can comment on or make changes to this bug.