From f4aacb646ae3990a67009686dfc2e6a747cf7e0b Mon Sep 17 00:00:00 2001 From: Kenneth Shaw Date: Wed, 3 Apr 2024 09:23:02 +0700 Subject: [PATCH] Unhide hidden / aliased flags on completion --- run.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/run.go b/run.go index e92b003d922..52b9e684a6d 100644 --- a/run.go +++ b/run.go @@ -84,6 +84,18 @@ func New(cliargs []string) ContextExecutor { _ = cmd.Flags().Set(f.Name, fmt.Sprintf("%v", v.Get(f.Name))) } }) + + // unhide params + switch { + case bashCompletion, + zshCompletion, + fishCompletion, + powershellCompletion, + cmd.Name() == "__complete": + for _, name := range []string{"no-psqlrc", "no-usqlrc", "var", "variable"} { + cmd.Root().Flags().Lookup(name).Hidden = false + } + } return nil }, RunE: func(cmd *cobra.Command, cliargs []string) error {