John Ferlan wrote: > > > On 01/13/2018 02:00 AM, Roman Bogorodskiy wrote: > > Completion in virsh is enabled when readline is available. However, > > when it's not available, we should: > > > > * avoid defining completers with completion functions; > > * in cmdComplete(), mark unused arguments when there's no readline with > > ATTRIBUTE_UNUSED. > > --- > > tools/virsh-domain-monitor.c | 6 ++++++ > > tools/virsh-domain.c | 6 ++++++ > > tools/virsh.h | 11 ++++++++++- > > tools/virt-admin.c | 14 ++++++++++++++ > > tools/vsh.c | 2 +- > > 5 files changed, 37 insertions(+), 2 deletions(-) > > > > Any chance to reduce the number of places to change that we can modify > virsh-completer.c to have the "#if WITH_READLINE" where the #else would > just return NULL and uses virCheckFlags(-1, NULL); to avoid the > syntax-check issue for the two API's defined so far? > > Reading vshReadlineParse it seems as if the .completer returns NULL, > then it's no different than if the .completer was NULL. > > I'm only one cup of coffee in though - so I could be wrong ;-). It > would have been "better" if the two new API's came with some > documentation over usage expectations (grumble, grumble). > > John Sent out v2. Brief testings shows virsh working as usual with this change. Roman Bogorodskiy
Attachment:
signature.asc
Description: PGP signature
-- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list