From 9045eb7ff4796c592b56e087b0947e0a360525cf Mon Sep 17 00:00:00 2001 From: Juerd Waalboer Date: Mon, 30 Jan 2023 17:19:50 +0100 Subject: [PATCH] Don't tab complete invalid input Products and users that begin with `+` are internal, as are users that begin with `-`. These should be excluded from tab completion. --- plugins/products | 2 +- revbank | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/products b/plugins/products index c176480..7fe1ae8 100644 --- a/plugins/products +++ b/plugins/products @@ -151,5 +151,5 @@ sub command :Tab(&tab) ($self, $cart, $command, @) { } sub tab { - return grep /\D/, keys %{ read_products() }; + return grep !/^\+/, grep /\D/, keys %{ read_products() }; } diff --git a/revbank b/revbank index aac9cf3..1a4c4a5 100755 --- a/revbank +++ b/revbank @@ -175,7 +175,8 @@ OUTER: for (;;) { } } if (delete $completions{USERS}) { - $completions{$_}++ for RevBank::Users::names; + $completions{$_}++ for grep !RevBank::Users::is_hidden($_), + RevBank::Users::names; } if (delete $completions{NOABORT}) { delete $completions{abort};