From 43e4ad49f76b7e98b4d6b3c869adca936faf4f06 Mon Sep 17 00:00:00 2001 From: Jun Nishimura Date: Sun, 9 Jul 2023 16:10:56 +0900 Subject: [PATCH] DisableFlagParsing in bash, zsh, fish, powershell set to true --- completions.go | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/completions.go b/completions.go index ee38c4d0..f8b5167f 100644 --- a/completions.go +++ b/completions.go @@ -713,6 +713,7 @@ You will need to start a new shell for this setup to take effect. `, c.Root().Name()), Args: NoArgs, DisableFlagsInUseLine: true, + DisableFlagParsing: true, ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { return cmd.Root().GenBashCompletionV2(out, !noDesc) @@ -748,8 +749,9 @@ To load completions for every new session, execute once: You will need to start a new shell for this setup to take effect. `, c.Root().Name()), - Args: NoArgs, - ValidArgsFunction: NoFileCompletions, + Args: NoArgs, + DisableFlagParsing: true, + ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { if noDesc { return cmd.Root().GenZshCompletionNoDesc(out) @@ -776,8 +778,9 @@ To load completions for every new session, execute once: You will need to start a new shell for this setup to take effect. `, c.Root().Name()), - Args: NoArgs, - ValidArgsFunction: NoFileCompletions, + Args: NoArgs, + DisableFlagParsing: true, + ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { return cmd.Root().GenFishCompletion(out, !noDesc) }, @@ -798,8 +801,9 @@ To load completions in your current shell session: To load completions for every new session, add the output of the above command to your powershell profile. `, c.Root().Name()), - Args: NoArgs, - ValidArgsFunction: NoFileCompletions, + Args: NoArgs, + DisableFlagParsing: true, + ValidArgsFunction: NoFileCompletions, RunE: func(cmd *Command, args []string) error { if noDesc { return cmd.Root().GenPowerShellCompletion(out)