[pve-devel] [PATCH common 0/2] fix partial shell completion

Stoiko Ivanov s.ivanov at proxmox.com
Tue Jul 30 14:42:10 CEST 2019


Since a while partial command completion ('qm re<TAB><TAB>' yielding
'rescan  reset   resize  resume' and completing to 'qm res')
has not been working (broke with release of libpve-common-perl 5.0-33).

The issue was introduced by setting the returned command-definition ($cmdref,
$ref) to undef in cases there is no complete match - which is useful for usage
messages (see 57c0d0c69c687f2dff876aa81369622d0ae0a841 for a good example).

The proposed fix reintroduces the functionality by keeping the behavior before
57c0d0c69c687f2dff876aa81369622d0ae0a841 if the partial command is a prefix of
a valid command, and returns undef otherwise.

Roughly tested, but 'resolve_cmd' is used in quite a few contexts and its
return values often serve more than one purpose - so I'd be grateful for
a review!

Stoiko Ivanov (2):
  CLIHandler: remove spurious abort()
  CLIHandler: consider valid prefixes for completion

 src/PVE/CLIHandler.pm | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

-- 
2.20.1





More information about the pve-devel mailing list