[libvirt-users] virsh and bash_complete

On 03/23/2016 04:57 PM, Mohsen Pahlevanzadeh wrote:
Dear All,
I downloaded the attachment file and activate for bash_complete, It can give you the following output: # virsh net- net-autostart net-dhcp-leases net-info net-undefine net-create net-dumpxml net-list net-update net-define net-edit net-name net-uuid net-destroy net-event net-start
Thanks; but that's fragile. You have to constantly maintain the bash script to keep up with additions to virsh. Much better would be adding a 'virsh complete' command, which takes the remaining command line arguments, and provides the context-sensitive completion list that best fits what the rest of the command line would be looking for if done in isolation. Then the bash completion wrapper would merely forward the current command line to 'virsh complete', and you'd only ever have to write the bash wrapper once, rather than maintaining it through each virsh addition. At one point, a student attempted work on this for Google Summer of Code (I think 2014?), but didn't get anywhere. It is still a GREAT idea, if someone wants to tackle it. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 23.03.2016 23:57, Mohsen Pahlevanzadeh wrote:
Dear All,
I downloaded the attachment file and activate for bash_complete, It can give you the following output: # virsh net- net-autostart net-dhcp-leases net-info net-undefine net-create net-dumpxml net-list net-update net-define net-edit net-name net-uuid net-destroy net-event net-start
--Best regards Mohsen
There's a GSoC project idea aiming exactly at this: http://wiki.libvirt.org/page/Google_Summer_of_Code_2016#Making_virsh_more_ba... Consider applying if applicable. Michal
participants (3)
-
Eric Blake
-
Michal Privoznik
-
Mohsen Pahlevanzadeh