Project

General

Profile

Bug #5417

Help screen formatting for commands with long options is hard to read

Added by David Davis over 8 years ago. Updated about 4 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

See the screenshot. Stuff isn't lined up.

Associated revisions

Revision c7d152d1 (diff)
Added by Tomáš Strachota almost 8 years ago

Fixes #5417 - readable help for long options

Revision 4dd07b9e
Added by Martin Bacovsky almost 8 years ago

Merge pull request #139 from tstrachota/help_format

Fixes #5417 - readable help for long options

History

#1 Updated by Tomáš Strachota almost 8 years ago

Printing the descriptions at new lines for long options could improve the readability:

Options:
    --label LABEL                 Content view label
    --name NAME                   Name of the content view
    --organization ORGANIZATION_NAME 
                                  Organization name to search by
    --organization-id ORGANIZATION_ID
    --organization-label ORGANIZATION_LABEL 
                                  Organization label to search by
    --repository-ids REPOSITORY_IDS 
                                  List of repository ids
    -h, --help                    print help

Can be easily changed by overriding 'add_list' in our help builder. See the links for details:
https://github.com/theforeman/hammer-cli/blob/master/lib/hammer_cli/abstract.rb#L65
https://github.com/mdub/clamp/blob/master/lib/clamp/help.rb#L79

#2 Updated by The Foreman Bot almost 8 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 1.7.4
  • Pull request https://github.com/theforeman/hammer-cli/pull/139 added
  • Pull request deleted ()

#3 Updated by Tomáš Strachota almost 8 years ago

  • Assignee set to Tomáš Strachota

I did some testing and compared various formats. The most readable seems to be adding more indentation for long options to keep the columns aligned.
E.g.

Usage:
    hammer location add-compute-resource [OPTIONS]

Options:
 -h, --help                                print help
 --name NAME                               Location name
 --compute-resource COMPUTE_RESOURCE_NAME  Compute resource name
 --compute-resource-id COMPUTE_RESOURCE_ID  
 --id ID 

#4 Updated by Anonymous almost 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF