File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ import (
1919//go:embed completion-scripts/completion.*.gotmpl
2020var completionScripts embed.FS
2121
22+ type contextKey int
23+
24+ const contextKeyCompletionHandled contextKey = iota
25+
2226func shellCompletionCommand () * cli.Command {
2327 supportedShells , templates , err := getCompletionSupportedShells ()
2428 if err != nil {
@@ -45,7 +49,7 @@ func shellCompletionCommand() *cli.Command {
4549 cmd .ShellComplete (ctx , cmd )
4650 }
4751 // Mark that we handled completion so Action can skip
48- return context .WithValue (ctx , "completionHandled" , true ), nil
52+ return context .WithValue (ctx , contextKeyCompletionHandled , true ), nil
4953 }
5054 return ctx , nil
5155 },
@@ -60,7 +64,7 @@ func shellCompletionCommand() *cli.Command {
6064 },
6165 Action : func (ctx context.Context , cmd * cli.Command ) error {
6266 // If completion was handled in Before, skip normal action
63- if ctx .Value ("completionHandled" ) != nil {
67+ if ctx .Value (contextKeyCompletionHandled ) != nil {
6468 return nil
6569 }
6670
You can’t perform that action at this time.
0 commit comments