cobra
cobra copied to clipboard
A Commander for modern Go CLI interactions
Reading the documentation on the front page, it is not clear to me what the best practice for raising errors from a command's `Run` func is? Looking at usage of...
I want to open file with filepath assigned in flag This is my code ```go package main import ( "fmt" "os" "github.com/spf13/cobra" ) var ( file string rootCmd = &cobra.Command{...
Currently, the generated markdown and the help command do not give any information about deprecated flags in the output and in the markdown. So, this might cause the user's not...
Hi! I want to ask, if there is an option to mark one of `n` of the mutually exclusive flags required? This means there must appear exactly one of the...
```shell $ set -u $ foo=() $ echo ${#foo} bash: foo: unbound variable echo ${#foo[*]} 0 ```
Hi, dear reviewers, In my project, there is one complex command with a lot of flags, we need to set part of them as required, and other flags are optional,...
It was pointed out on Slack that there is no explanation in the docs of what the `toComplete` parameter represents for `ValidArgsFunction`. This PR explains with examples the `toComplete` and...
This supersedes #1450 and #1392 When a program has no sub-commands, its root command can accept arguments. If we add the default "completion" command to such programs they will now...
I ran across a possible problem with using powershell completion with aliases. I can't recall where it was though, but the situation is pretty simple. IIUC, when a user has...
For example, I have a root command with sub-command `run`. And sub command `run` have a nested sub-command `test`. Suppose that my command line called `foo`. The problem is if...