Edgewall Software
Modify

Opened 19 years ago

Closed 18 years ago

Last modified 18 years ago

#2496 closed defect (fixed)

trac-admin help is illegible due to long lines

Reported by: mdaniel@… Owned by: Christian Boos
Priority: normal Milestone: 0.10
Component: admin/console Version: 0.9.2
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

On an 80x25 xterm, the output from trac-admin help is not very legible because the "help text" spills over into the next line where one would expect a command to be.

initenv                                                -- Create and initialize 
a new environment interactively
initenv <projectname> <db> <repospath> <templatepath>  -- Create and initialize 
a new environment from arguments

See?

One suggestion would be to employ newlines and indenting spaces:

initenv
    * Create and initialize lorem ipsum donet ipsum
initenv <projectname> <db> <foo> <bar>
    * Does other cool thing lorem ipsum

Attachments (1)

help_newline.diff (1.6 KB ) - added by adeason@… 19 years ago.
Preliminary patch, puts help descriptions on different lines.

Download all attachments as: .zip

Change History (10)

comment:1 by adeason@…, 19 years ago

I attached an example patch. It introduces a new parameter to print_listing() called maxw, which I set to 80 in print_doc(). Right now the patch doesn't really make sure that the text keeps to 80 chars, but none of the help text is over 80 characters in length, so it works now. If someone would like to make it wrap the text to maxw chars, that would probably be better. And also examining the environment for the actual number of columns that should be used would be better.

by adeason@…, 19 years ago

Attachment: help_newline.diff added

Preliminary patch, puts help descriptions on different lines.

comment:2 by Christopher Lenz, 19 years ago

Milestone: 1.0
Owner: changed from daniel to Christopher Lenz
Status: newassigned

The plan for trac-admin is to get rid of those required arguments for initenv and provide an option-based interface instead. This means that the help text would be reorganized a bit: the listing would just contain [options], and the detailled help for initenv would then list the options.

comment:3 by Christopher Lenz, 19 years ago

#2579 has been marked as duplicate of this ticket.

comment:4 by Christopher Lenz, 19 years ago

Milestone: 1.00.10

comment:5 by Christian Boos, 18 years ago

Owner: changed from Christopher Lenz to Christian Boos
Status: assignednew

Maybe we can do a simpler fix for now, which would solve that issue without having to wait for a larger refactoring…

comment:6 by Christian Boos, 18 years ago

Resolution: fixed
Status: newclosed

Fix committed in r3367 (simply bypass the print_listing method and print command and description on separate lines).

comment:7 by Christopher Lenz, 18 years ago

Hmm, why all the extra empty lines?

comment:8 by Christian Boos, 18 years ago

Readability? I found it was too compact.

Anyway, a better fix would be to have for each command a short and a longer help. The first line will be used in a compact, global, help. The second will be used when asking for help on that specific command.

That's how Mercurial does it, and it's a good model, I think.

e.g. the global help:

$ hg help
Mercurial Distributed SCM

list of commands (use "hg help -v" to show aliases and global options):

 add        add the specified files on the next commit
 annotate   show changeset information per file line
 archive    create unversioned archive of a repository revision
 backout    reverse effect of earlier changeset
 bundle     create a changegroup file
 cat        output the latest or given revisions of files
 clone      make a copy of an existing repository
...

the specific help:

hg add [OPTION]... [FILE]...

add the specified files on the next commit

    Schedule files to be version controlled and added to the repository.

    The files will be added to the repository at the next commit.

    If no names are given, add all files in the repository.

options:

 -I --include  include names matching the given patterns
 -X --exclude  exclude names matching the given patterns

and the corresponding bits of source code:

def add(ui, repo, *pats, **opts):
    """add the specified files on the next commit

    Schedule files to be version controlled and added to the repository.

    The files will be added to the repository at the next commit.

    If no names are given, add all files in the repository.
    """

the options doc come from another data structure:

    ...
    "^add":
        (add,
         [('I', 'include', [], _('include names matching the given patterns')),
          ('X', 'exclude', [], _('exclude names matching the given patterns'))],
         _('hg add [OPTION]... [FILE]...')),
     ...

comment:9 by Emmanuel Blot, 18 years ago

Readability? I found it was too compact.

-1, it makes the help message hard to read on a small terminal (vertical scrolling…)

Anyway, a better fix would be to have for each command a short and a longer help.

+1 (without the extra spaces from the add example).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.