aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/cobra/README.md
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-05-22 20:53:53 +0200
committerMichael Muré <batolettre@gmail.com>2019-05-22 20:53:53 +0200
commit485ca5900486b7fc3ea71cbcbb39b87272ae09fd (patch)
tree92551be8e01130542f969d06282abfc4a1c43629 /vendor/github.com/spf13/cobra/README.md
parente781d6c7fe7dba2fc526c2049aa188c9988e1cf4 (diff)
downloadgit-bug-485ca5900486b7fc3ea71cbcbb39b87272ae09fd.tar.gz
vendor: update dependencies
Diffstat (limited to 'vendor/github.com/spf13/cobra/README.md')
-rw-r--r--vendor/github.com/spf13/cobra/README.md52
1 files changed, 25 insertions, 27 deletions
diff --git a/vendor/github.com/spf13/cobra/README.md b/vendor/github.com/spf13/cobra/README.md
index 851fcc08..ff16e3f6 100644
--- a/vendor/github.com/spf13/cobra/README.md
+++ b/vendor/github.com/spf13/cobra/README.md
@@ -2,25 +2,28 @@
Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files.
-Many of the most widely used Go projects are built using Cobra including:
-
-* [Kubernetes](http://kubernetes.io/)
-* [Hugo](http://gohugo.io)
-* [rkt](https://github.com/coreos/rkt)
-* [etcd](https://github.com/coreos/etcd)
-* [Moby (former Docker)](https://github.com/moby/moby)
-* [Docker (distribution)](https://github.com/docker/distribution)
-* [OpenShift](https://www.openshift.com/)
-* [Delve](https://github.com/derekparker/delve)
-* [GopherJS](http://www.gopherjs.org/)
-* [CockroachDB](http://www.cockroachlabs.com/)
-* [Bleve](http://www.blevesearch.com/)
-* [ProjectAtomic (enterprise)](http://www.projectatomic.io/)
-* [GiantSwarm's swarm](https://github.com/giantswarm/cli)
-* [Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack)
-* [rclone](http://rclone.org/)
-* [nehm](https://github.com/bogem/nehm)
-* [Pouch](https://github.com/alibaba/pouch)
+Many of the most widely used Go projects are built using Cobra, such as:
+[Kubernetes](http://kubernetes.io/),
+[Hugo](http://gohugo.io),
+[rkt](https://github.com/coreos/rkt),
+[etcd](https://github.com/coreos/etcd),
+[Moby (former Docker)](https://github.com/moby/moby),
+[Docker (distribution)](https://github.com/docker/distribution),
+[OpenShift](https://www.openshift.com/),
+[Delve](https://github.com/derekparker/delve),
+[GopherJS](http://www.gopherjs.org/),
+[CockroachDB](http://www.cockroachlabs.com/),
+[Bleve](http://www.blevesearch.com/),
+[ProjectAtomic (enterprise)](http://www.projectatomic.io/),
+[Giant Swarm's gsctl](https://github.com/giantswarm/gsctl),
+[Nanobox](https://github.com/nanobox-io/nanobox)/[Nanopack](https://github.com/nanopack),
+[rclone](http://rclone.org/),
+[nehm](https://github.com/bogem/nehm),
+[Pouch](https://github.com/alibaba/pouch),
+[Istio](https://istio.io),
+[Prototool](https://github.com/uber/prototool),
+[mattermost-server](https://github.com/mattermost/mattermost-server),
+etc.
[![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra)
[![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token "CircleCI status")](https://circleci.com/gh/spf13/cobra)
@@ -152,9 +155,6 @@ In a Cobra app, typically the main.go file is very bare. It serves one purpose:
package main
import (
- "fmt"
- "os"
-
"{pathToYourApp}/cmd"
)
@@ -265,9 +265,6 @@ In a Cobra app, typically the main.go file is very bare. It serves, one purpose,
package main
import (
- "fmt"
- "os"
-
"{pathToYourApp}/cmd"
)
@@ -395,6 +392,7 @@ The following validators are built in:
- `MinimumNArgs(int)` - the command will report an error if there are not at least N positional args.
- `MaximumNArgs(int)` - the command will report an error if there are more than N positional args.
- `ExactArgs(int)` - the command will report an error if there are not exactly N positional args.
+- `ExactValidArgs(int)` - the command will report an error if there are not exactly N positional args OR if there are any positional args that are not in the `ValidArgs` field of `Command`
- `RangeArgs(min, max)` - the command will report an error if the number of args is not between the minimum and maximum number of expected args.
An example of setting the custom validator:
@@ -404,7 +402,7 @@ var cmd = &cobra.Command{
Short: "hello",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) < 1 {
- return errors.New("requires at least one arg")
+ return errors.New("requires a color argument")
}
if myapp.IsValidColor(args[0]) {
return nil
@@ -464,7 +462,7 @@ Echo works a lot like print, except it has a child command.`,
}
var cmdTimes = &cobra.Command{
- Use: "times [# times] [string to echo]",
+ Use: "times [string to echo]",
Short: "Echo anything to the screen more times",
Long: `echo things multiple times back to the user by providing
a count and a string.`,