Bug 885635

Summary: wrong auto completion of option: option that appears in help and after pressing tab differers from option that actually auto completed
Product: Red Hat Enterprise Virtualization Manager Reporter: Ilia Meerovich <iliam>
Component: ovirt-engine-cliAssignee: Michael Pasternak <mpastern>
Status: CLOSED NOTABUG QA Contact: Ilia Meerovich <iliam>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: bazulay, dyasny, ecohen, hateya, iheim, oramraz, Rhev-m-bugs, ykaul
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-12-12 07:44:19 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ilia Meerovich 2012-12-10 09:45:09 UTC
Wrong auto completion:

group, cluster, datacenter, host, storagedomain, template, user, vmpool  options auto completes to --<option>-identifier instead of --<option>

Please take a look:

[RHEVM shell (connected)]# add permission --group-identifier
[RHEVM shell (connected)]# add permission
cluster        datacenter     group          host           storagedomain  template       user           vm             vmpool        
[RHEVM shell (connected)]# add permission --group-identifier

error: option --group-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --datacenter-identifier


error: option --datacenter-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --cluster-identifier


error: option --cluster-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --host-identifier


error: option --host-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --storagedomain-identifier


error: option --storagedomain-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --template-identifier


error: option --template-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --user-identifier


error: option --user-identifier cannot be empty.


[RHEVM shell (connected)]# add permission --vm


error: cannot create "permission" because permissions collection is not available or given arguments not valid.,
possible arguments combinations are [['host'], ['template'], ['storagedomain'], ['group'], ['user'], ['vmpool'], ['datacenter'], ['cluster'], ['vm']].


[RHEVM shell (connected)]# add permission --vmpool-identifier


error: option --vmpool-identifier cannot be empty.


[RHEVM shell (connected)]#

Comment 1 Michael Pasternak 2012-12-10 11:24:03 UTC
(In reply to comment #0)
> Wrong auto completion:
> 
> group, cluster, datacenter, host, storagedomain, template, user, vmpool 
> options auto completes to --<option>-identifier instead of --<option>

you're wrong, there is no such thing as --<option>, as --<option> represents resource which you should be identifiable, this is the same across the app.,

i.e permission/s are added to resource and resource identified as --<resource>-identifier, 

help shows:
==========

     Overload 3:
     
     * --role-id: string
     * --host-id: string

cli auto-completes to
=====================

add permission --host-identifier --role-id


you getting an error on empty identifier:
========================================

[RHEVM shell (connected)]# add permission --host-identifier

error: option --host-identifier cannot be empty.

(also you're not specifying --role-id)

to summarise:
============

you can argue that from --host-id in help is not clear that it should be
resolved to the --host-identifier, but this is what for auto-completion 
is exist (also form user pov 'id' is synonym of 'identifier').

Comment 2 Michael Pasternak 2012-12-12 07:44:19 UTC
there is a technical restriction for parent objects to be identified in different manner (--<resource>-identifier).