cobra
cobra copied to clipboard
A Commander for modern Go CLI interactions
In the run of `rosa` below the error message is `unknown flag: --prefix`, however the true error message should be something like `unknown sub-command: ocm-roles` (proper sub-command is singular). Is...
This PR addresses #1895, adding an easy way to ignore args after the arg terminator --. It also add easy retrieving of such arguments to easily manipulate them. It is...
I want to keep a variable as nil except explicitly set, but only `true` or `false` is allowed. ```go myCmd.Flags().BoolVar(&isMine, "isMine", nil, "") ```
Add `Annotation` suffix to the private annotations to allow nicer code using the constants. For example one can use the current annotation names as a temporary variable instead of unclear...
This short program causes data races when run with the race detector: ```go package main import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "golang.org/x/sync/errgroup" ) var ( _ = pflag.Int("a", 0, "") ) func...
I'm trying to establish what the correct pattern is for exiting a command with a non zero return code. I can use RunE, but the normal effect of that is...
This may be better suited in the `spf13/pflag` project, but my expectation is that more people use Cobra than pflag directly. I was recently using Cobra to parse a custom...
There are few fixes since 1.8.0 - the fixes I'm interested in are mainly: - a73b9c391a9489d20f5ee1480e75d3b99fc8c7e2 - df547f5fc6ee86071f73c36c16afd885bb4e3f28 I can build with latest cobra, but I would like to depend...
Special characters include whitepace, so this is more general than #1743. This should also fix #1740. I added some test cases to cobra-completion-testing. This PR makes them pass. It also...
Currently I don't see any error message being displayed on wrong subcommand. How to create an error message for the same? I'm trying to add this feature in https://github.com/keploy/keploy