Usage is inconsistent and does not follow usage standards

Bug #1155171 reported by Alex Meade
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Low
Gabe Westmaas

Bug Description

Option arguments for glanceclient commands use differing usage syntax:

For example, glance help image-list uses curly braces for option choices
...
Optional arguments:
...
  --sort-key {name,status,container_format,disk_format,size,id,created_at,updated_at}
                        Sort image list by specified field.
  --sort-dir {asc,desc}
                        Sort image list in specified direction.
...

while glance help image-update shows square brackets for option choices:
...
Optional arguments:

...
  --is-public [True|False]
                        Make image accessible to the public.
  --is-protected [True|False]
                        Prevent image from being deleted.
...

There is no clear standard for how to handle the listing of choices but square brackets are always used to show optional parameters which these are not.

The IEEE standard does not seem to be clear on what to do:
http://pubs.opengroup.org/onlinepubs/009604499/basedefs/xbd_chap12.html

This link says to use curly braces for option choices:
http://www.aps.anl.gov/Accelerator_Systems_Division/Accelerator_Operations_Physics/manuals/SDDStoolkit/node26.html

Alex Meade (alex-meade)
Changed in python-glanceclient:
importance: Undecided → Low
Revision history for this message
Yeukhon (yeukhon) wrote :

In the legacy shell, they use brackets.
The thing is, those with {} are the product of argparse's internal rendering.
http://docs.python.org/3.4/library/argparse.html#choices

whereas the rest are hardcode.
I personally would go with the dicts for one reason: there are too many brackets already and the cmds are already too long, too much to digest for my human eyes...

Gabe Westmaas (westmaas)
Changed in python-glanceclient:
assignee: nobody → Gabe Westmaas (westmaas)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/43601

Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/43601
Committed: http://github.com/openstack/python-glanceclient/commit/b6e117f151e6d3ed8dc4849c4138d7fb28652e75
Submitter: Jenkins
Branch: master

commit b6e117f151e6d3ed8dc4849c4138d7fb28652e75
Author: Gabe Westmaas <email address hidden>
Date: Sun Aug 25 01:14:07 2013 +0000

    Fix glanceclient usage inconsistences for options

    Enumerated options should have the same format for all enumerated options.

    This commit moves all options to the {option1,option2} format.

    fixes bug: #1155171

    Change-Id: I8e0ecf3896c76021cb027cbbbb3b5564a04aacec

Changed in python-glanceclient:
status: In Progress → Fix Committed
Louis Taylor (kragniz)
Changed in python-glanceclient:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.