Bug 854506 - "collection based arguments syntax" help message has errors
Summary: "collection based arguments syntax" help message has errors
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-cli
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
: ---
Assignee: Michael Pasternak
QA Contact: Ilia Meerovich
URL:
Whiteboard: infra
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-09-05 08:25 UTC by Ilia Meerovich
Modified: 2016-07-05 00:07 UTC (History)
8 users (show)

Fixed In Version: si18
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-12-04 19:57:11 UTC
oVirt Team: Infra
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ilia Meerovich 2012-09-05 08:25:10 UTC
Please take a look at this help message:
"""
[RHEVM shell (connected)]# create datacenter 

error: 
status: 400
reason: Bad Request
detail: DataCenter [name, storageType] required for add

[RHEVM shell (connected)]# help create datacenter 

USAGE
  
  create <type> [base identifiers] [attribute options]
  
DESCRIPTION
  
  Create a new object with type datacenter. See 'help create' for generic
  help on creating objects.
  
ATTRIBUTE OPTIONS
  
  The following options are available for objects with type datacenter:
  
    * --name: string
    * --storage_type: string
    * --version-major: int
    * --version-minor: int
    * [--description: string]
    * [--storage_format: string]
    * [--expect: 201-created]
    * [--correlation_id: anystring]
  
    Note: collection based arguments syntax is:
    --<type>.<collection-obj>.<collection-member> "<collection-item>.<collection-item-property>=value,..."
  
    e.g:
  
    --power_management-options-option "option.name=n1,option.value=v1"
    --power_management-options-option "option.name=n2,option.value=v2"
  
RETURN VALUES
  
    * 002 (COMMAND_ERROR)
    * 003 (INTERRUPTED)
    * 011 (NOT_FOUND)
    * 000 (OK)
    * 010 (REMOTE_ERROR)
    * 001 (SYNTAX_ERROR)
    * 004 (UNKNOWN_ERROR)
"""

Collection based arguments syntax described incorrectly:
it should be:
--<type>-<collection-obj>-<collection-member> "<collection-item>.

Comment 1 Michael Pasternak 2012-09-05 10:20:24 UTC
it is correct:

<collection-item> -> option
<collection-item-property> -> name
value -> n1

Comment 2 Ilia Meerovich 2012-09-05 10:38:55 UTC
How can system administrator understand from:
"""
 --<type>.<collection-obj>.<collection-member> "<collection-item>.<collection-item-property>=value,..."
"""
that he should write:
"""
--power_management-options-option "option.name=n1,option.value=v1

"""
?

User cannot understand it.
that's why help message should be changed from  --<type>.<collection-obj>.<collection-member>
to --<type>-<collection-obj>-<collection-member> - this way user will be able to correlate between you help message and usage.

Comment 3 Michael Pasternak 2012-09-05 12:09:57 UTC
ilia, this is not a bug and template is correct 

<collection-item-property> == option.name

Comment 5 Ilia Meerovich 2012-11-25 10:23:17 UTC
old format still exists in:
rhevm-cli-3.1.0.17-1.el6ev.noarch

Comment 6 Michael Pasternak 2012-11-25 10:37:49 UTC
(In reply to comment #5)
> old format still exists in:
> rhevm-cli-3.1.0.17-1.el6ev.noarch

this is not correct, .17 has:
=============================

COLLECTION BASED OPTION FORMAT
  
    * [--x-y: collection]
      {
        [y.a: string]
        [y.b: string]
        [y.c: string]
      }
  
    e.g:
  
    --x-y "y.a=a1,y.b=b1,y.c=c1"
    --x-y "y.a=a2,y.b=b2,y.c=c2"
    ...
  
    where a, b, c are option properties and aN, bN, cN is actual user's data

while old format is:
===================

    Note: collection based arguments syntax is:
    --<type>.<collection-obj>.<collection-member> "<collection-item>.<collection-item-property>=value,..."
  
    e.g:
  
    --power_management-options-option "option.name=n1,option.value=v1"
    --power_management-options-option "option.name=n2,option.value=v2"

Comment 7 Ilia Meerovich 2012-11-27 13:18:08 UTC
rechecked


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