glance-specs/specs/juno/add-bash-completion.rst
Juan Manuel Olle 6e94ff65c3 Add bash completion to glance client
Currently glance client does not support command completion.
The intention is to add this functionality to the client

blueprint add-bash-completion

Change-Id: Ia13a119967b15d44918a1f7d51b9f142640865cc
2014-06-23 09:58:46 -03:00

137 lines
2.5 KiB
ReStructuredText
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

..
This work is licensed under a Creative Commons Attribution 3.0 Unported
License.
http://creativecommons.org/licenses/by/3.0/legalcode
==========================================
Add bash completion for command line
==========================================
https://blueprints.launchpad.net/python-glanceclient/+spec/add-bash-completion
Currently glance client does not support command completion.
The intention is to add this functionality to the client.
Problem description
===================
Nowadays glance client does not have bash completion for the command line.
This feature will improve the client usability.
Proposed change
===============
Incorporation of bash completion feature.
This feature uses the linux script called bash_completion.d to 
request all the commands and parameters to Glance through 
bash_completion command. After obtaining them, they are filtered 
and shown. 
Example of use:
glance <tab><tab> ---> shows all the commands
glance image- <tab><tab> ---> shows all the commands starting with the
word image: image-list, image-show, image-create… 
If there is only one, it will be completed.
glance image-create <tab><tab> ---> shows all optional arguments
To complete this feature, it is needed to modify devstack and the packaging
tool in order to include this script in the installer (deb, rpm).
Alternatives
------------
None
Data model impact
-----------------
None
REST API impact
---------------
None
Security impact
---------------
None
Notifications impact
--------------------
None
Other end user impact
---------------------
None
Performance Impact
------------------
None
Other deployer impact
---------------------
This change needs copying of the glance.bash_completion to specific
system path:
* This will affect devstack
* This will affect specific packaging (deb, rpm)
Developer impact
----------------
Commands and Parameters are extracted directly from argparse.
Developers won't need to maintain a separate list when they add new
commands or parameters.
Implementation
==============
Assignee(s)
-----------
Primary assignee:
<juan-m-olle>
Work Items
----------
This feature needs:
* To add glance.bash_completion script
* To add bash_completion command to glance client. This new command
returns all available commands the client has and it is used by
glance.bash_completion.
Dependencies
============
None
Testing
=======
Unit test will check new shell command functionality.
Documentation Impact
====================
New feature needs to be mentioned.
References
==========
None