]> xenbits.xensource.com Git - libvirt.git/commit
vsh: Deduplicate filtering in vshReadlineOptionsGenerator()
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 2 Feb 2021 10:38:17 +0000 (11:38 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 10 Feb 2021 10:51:59 +0000 (11:51 +0100)
commitc3ea585e186d5e4524df889e8955d23f74bfed56
treefaab000a8b5052b6520d4267320c0d85480375a3
parent3cc6572fab195173d365c0ed954a70de1b120550
vsh: Deduplicate filtering in vshReadlineOptionsGenerator()

Completer callbacks generate all possible outputs ignoring any partial
input (e.g. prefix of a domain name) and then use vshCompleterFilter() to
filter out those strings which don't fit the partial input (prefix).

In contrast, vshReadlineOptionsGenerator() does some internal filtering and
only generates completions that match a given prefix. Rather than treating
these scenarios differently, simply generate all possible options and
filter them all at the end.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
tools/vsh.c