cobra
cobra copied to clipboard
A Commander for modern Go CLI interactions
It would be nice if there was a switch to allow subcommands in the `app parent:child` form, rather than `app parent child`. Heroku has made [an argument for using the...
I'm building an application that will listen text messages through slack and pass it through to CLI to execute messages. However, as the command object holds contextual data such as...
It would be good for Cobra to have a function to force reparsing for flags. eg. after the application has already started and the initial flag parsing has already been...
Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 3.7.0 to 4.0.0. Release notes Sourced from golangci/golangci-lint-action's releases. v4.0.0 What's Changed Documentation docs: update examples by @KunalSin9h in golangci/golangci-lint-action#826 docs: update section about GitHub Annotations by...
Cobra, in its default configuration, will execute a template to generate help, usage and version outputs. Text/template execution calls MethodByName and MethodByName disables dead code elimination in the Go linker,...
Apologies if this has been asked or answered before. I've worked extensively with cobra for creating cli interfaces. One sort of creative approach I've taken on occasion is to re-invoke...
Use common useline notation for available flags: - `[-f foo]` for (standard) optional flags - `[-f foo | -b bar]` for mutually exclusive flags - `-f foo` for required flags...
## Problem I have unit tests that cover creating cobra commands, and when I run them using [Ginkgo](https://github.com/onsi/ginkgo), I get an error about an unknown flag that I never explicitly...
``` cmd ㄴroot.go ㄴtest ㄴcmd.go ㄴtest_cmd.go ㄴtest_sub.go ``` ```golang // root.go ... func init() { RootCmd.PersistentFlags().StringVar(&profile, "profile", "default", "input dev profile, if needed") ... RootCmd.AddCommand(test.GetCommands()...) } ``` ```golang // cmd.go...
A helper to run a function if a command is killed.