[libvirt] [PATCH 0/4] Virsh: Extend command arguments completion

Michal Privoznik mprivozn at redhat.com
Mon Jul 4 08:41:24 UTC 2011

This patchset extends arguments completion for virsh commands. Currently only
for domain related (start, destroy, etc.) and 'help'. But if community is
satisfied with this little part I'll write follow up patches for other commands
as well.

This means that for command start not only pre-defined options will be generated
(autodestroy, console, paused) but names of inactive domains too. However, this
requires virsh to be already connected to daemon. Completers for commands can be
easily defined as they follow readline logic. Basically, completer returns on
each call one string (=possible argument/option) and it's called repeatedly
until NULL is returned. To generate only corresponding values for given prefix,
there is @text variable in function prototype. There is also @state variable
that is set to zero on the 1st call and to non-zero on any subsequent calls,
so completer can set it internal structures.

Michal Privoznik (4):
  virsh: make conn global
  virsh: Extend virsh commands definition with completer
  virsh: Create completer for commands related to domains
  virsh: Create completer for help command

 tools/virsh.c | 1108 ++++++++++++++++++++++++++++++++++-----------------------
 1 files changed, 660 insertions(+), 448 deletions(-)


More information about the libvir-list mailing list