Re: [PATCH 08/12] vsh: Deduplicate filtering in vshReadlineOptionsGenerator()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/9/21 5:00 PM, Jonathon Jongsma wrote:
On Thu,  4 Feb 2021 15:13:33 +0100
Michal Privoznik <mprivozn@xxxxxxxxxx> wrote:

This is what we do for completer callbacks: we let them 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).

The same algorithm is implemented in
vshReadlineOptionsGenerator() even though a bit differently.
There is no need to have the same code twice.

I think this might be clearer stated a bit differently. For example, if
I'm understanding correctly, a suggested alternate commit message:

     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.

Yup, this sounds way better. Thanks!

Michal




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux