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

Improve site formatting to make it easier to maintain and have nicer output. Preview: - https://github.com/nirs/cobra/blob/site-formatting/site/content/user_guide.md - https://github.com/nirs/cobra/blob/site-formatting/site/content/active_help.md

When writing a plugin and setting CommandDisplayNameAnnotation you want the display name to be used in help text. This did not work when setting command Version since the help text...

area/docs-generation
area/github

This commit makes unknown commands a proper error type so that the caller can check for this specific error type without having to do string comparisons. This is useful in...

Hi, For nerdctl, we are interested in displaying different completion if called with sudo vs. called directly. (https://github.com/containerd/nerdctl/issues/99 ). Do you have a recommendation on how to implement this /...

Proposed a backward compatible solution to https://github.com/spf13/cobra/issues/2130 Hereto a new flag `ErrorOnUnknownSubcommand` was added to the `Command` struct. Unit tests were added accordingly (TestSubcommandExecuteMissingSubcommand and TestSubcommandExecuteMissingSubcommandWithErrorOnUnknownSubcommand. Fixes #1156 #2130

for example: input: main-cobra import -i aaa -c ddd output import -i aaa -c ddd

``` --smtp-server-host string SMTP server host address to use for sending emails. Default: smtp.gmail.com --smtp-to string Address to send the diff email to. Defaults to smtp-user ``` I had a...

kind/feature
lifecycle/needs-pr

- relates to https://github.com/spf13/cobra/pull/155 - relates to https://github.com/docker/cli/pull/5224 When running tests in verbose mode (or other options), tests involving Cobra may fail if the test does not explicitly set Command.args...

Is there a recommended pattern for pre-processing the arguments? I have hundreds of commands in different projects which get passed in args, but some of the args may be encrypted...

Hey, I wanted to check the progress on getting `--help` to print the `ValidArgs` for a cmd. Almost every big arg-parser provided this functionality. Some have already written issues for...