cobra icon indicating copy to clipboard operation
cobra copied to clipboard

A Commander for modern Go CLI interactions

Results 294 cobra issues
Sort by recently updated
recently updated
newest added

In the [YAML docs gen](https://github.com/spf13/cobra/blob/v1.8.1/doc/yaml_docs.go#L100-L101) the `cmd.Long` maps to the description and `cmd. Short` maps to the synopsis. In the other outputs, it's the reverse. For example, the [MD docs...

If I set up two flags as mutually exclusive, and I set one or the other in separate test runs, then Cobra will still think that I have set them...

These changes are to address #1140. I opted to add a net new method so we do not introduce a breaking change to the existing API. Anyone that wants the...

area/docs-generation

Fixes #2154 This PR makes sure that when Cobra calls `HelpFunc()(cmd, args)`, the proper arguments are passed to the function. With this, when the help function is overridden, the new...

I can override the help function using: - `cmd.SetHelpFunc(func(c *cobra.Command, args []string))`. Notice that the new help function I will define takes a command and its arguments as parameters, just...

kind/bug
area/cobra-command

Add function for checking whether flags are effective only if some other flags are set

When a command has persistent flags defined, these flags get inherited by all sub-commands and nested sub-commands. Let us consider an example. root - --subscription [persistent flag] - get -...

Right now there is a difference in handling between unknown command and unknown subcommand. Let's consider the example: ``` package main import "github.com/spf13/cobra" func main() { subCmd := &cobra.Command{ Use:...

kind/bug
area/cobra-command
triage/needs-triage

following the example using `cobra-cli init` and added a new flag. this works. but then the docs do not show how to use the value of a given arg or...

This is with cobra v0.0.5. This is some kind of meta-bug (we can separate this if needed, but I think a general view can help getting a global schema) to...

triage/needs-info