Project

General

Profile

Actions

Bug #5417

closed

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

Added by David Davis over 10 years ago. Updated over 6 years ago.

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

Description

See the screenshot. Stuff isn't lined up.


Files

Actions #1

Updated by Tomáš Strachota over 10 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

Actions #2

Updated by The Foreman Bot over 10 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 ()
Actions #3

Updated by Tomáš Strachota over 10 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 
Actions #4

Updated by Anonymous about 10 years ago

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

Also available in: Atom PDF