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

Today we have `cobra.OnInitialize` but unfortunately we don't have an API to return initialization errors. This aims to add `cobra.OnInitializeE` to accept `func() error` and returns error accordingly.

kind/feature
triage/needs-info
lifecycle/frozen
size/M

Previously, a command such as: &cobra.Command{Use: "run/first [OPTIONS] arg1 arg2"} would fail generation with an error "no such file or directory" because the generating code would expect some directory ending...

area/docs-generation
lifecycle/frozen
size/L

fixes #1663

area/docs-generation
lifecycle/frozen
size/XS

Resolves https://github.com/spf13/cobra/issues/1633

size/M

I was going through the user-guide which I'm not sure I had read through and through before. These are small ajustements I noticed were needed.

kind/documentation
size/M
lgtm

We added a `fig-autocomplete` hidden subcommand to Infracost and it increased the padding in the usage text (https://github.com/infracost/infracost/pull/1457#discussion_r827182625), which was unexpected. This fixes any hidden commands affecting the padding: Fixes...

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

os.Exit(1) kill process without defering functions. panic can be recover if needed. Signed-off-by: Guilhem Lettron

I've defined a subcommand with two boolean arguments and found it unexpectedly run into the subcommand. In specific, a subcommand naming "sub" with two boolean arguments "a" and "b". If...

kind/bug

The code below doesn't really need the `error` as return type, so I remove it ```go func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error { flags := cmd.NonInheritedFlags() flags.SetOutput(buf) if...

area/docs-generation