From a71a14305b5dc1743fed5424caa3161fb3973df5 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Fri, 26 Jul 2024 03:32:41 -0500 Subject: [PATCH] fix: Fix used values still showing in shell completion --- internal/visitor/find_args_completion.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/visitor/find_args_completion.go b/internal/visitor/find_args_completion.go index ab3040c..adf396a 100644 --- a/internal/visitor/find_args_completion.go +++ b/internal/visitor/find_args_completion.go @@ -21,13 +21,14 @@ func RegisterCompletion(cmd *cobra.Command, conf *config.Config) { } func valueCompletion(conf *config.Config) func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { - return func(_ *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { + return func(cmd *cobra.Command, args []string, _ string) ([]string, cobra.ShellCompDirective) { + _ = conf.Load(cmd) + if !strings.HasPrefix(conf.Prefix, "#") { conf.Prefix = "#" + conf.Prefix } v := NewFindArgs(conf) - for _, path := range args { stat, err := os.Stat(path) if err != nil {