]> git.ipfire.org Git - thirdparty/libvirt.git/commit
vshReadlineOptionsGenerator: Don't add already specified options to the list
authorMichal Privoznik <mprivozn@redhat.com>
Fri, 12 Jan 2018 16:05:33 +0000 (17:05 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 15 Jan 2018 14:45:14 +0000 (15:45 +0100)
commit98bc781b42f0991bf1dcd3e8535479343ddd4bf5
treeeb6a82af8b0add2dc1f58d7249d7a05e61151df7
parent44601840ddb233d9ce9ec72d67bdab74d208f32d
vshReadlineOptionsGenerator: Don't add already specified options to the list

The current state of art is as follows:

 1) vshReadlineOptionsGenerator() generate all possible --options
 for given command, and then
 2) vshReadlineOptionsPrune() clears out already provided ones
 from the list.

Not only this brings needless memory complexity it is also not
trivial to get right. We can switch to easier approach: just
don't add already specified --options in the first step.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
tools/vsh.c