We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to workaround #1877 by inspecting os.Args by hand. In some cases cobra accidentally inserts -- into os.Args.
os.Args
--
Minimal example:
package main import ( "os" "strings" "github.com/spf13/cobra" ) func main() { cmd := &cobra.Command{ TraverseChildren: true, ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]cobra.Completion, cobra.ShellCompDirective) { cobra.CompErrorln(strings.Join(os.Args[1:], ", ")) return nil, cobra.ShellCompDirectiveDefault }, } if err := cmd.Execute(); err != nil { panic(err) } }
Expected behaviour:
$ go run . __complete x [Debug] [Error] __complete, x :0 Completion ended with directive: ShellCompDirectiveDefault
Actual behaviour:
$ go run . __complete x [Debug] [Error] __complete, -- :0 Completion ended with directive: ShellCompDirectiveDefault
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm trying to workaround #1877 by inspecting
os.Args
by hand. In some cases cobra accidentally inserts--
intoos.Args
.Minimal example:
Expected behaviour:
Actual behaviour:
The text was updated successfully, but these errors were encountered: