Skip to content

Commit

Permalink
Removes viper dependency by removing cobra/ CLI tool
Browse files Browse the repository at this point in the history
The cobra bootstrapping CLI tool has moved to
https://github.com/spf13/cobra-cli

Signed-off-by: John McBride <jmcbride@vmware.com>
  • Loading branch information
jpmcb committed Feb 17, 2022
1 parent a599632 commit 91749ca
Show file tree
Hide file tree
Showing 32 changed files with 19 additions and 4,740 deletions.
7 changes: 1 addition & 6 deletions Makefile
Expand Up @@ -13,7 +13,7 @@ endif

default: all

all: fmt test cobra_generator
all: fmt test

fmt:
$(info ******************** checking formatting ********************)
Expand All @@ -27,11 +27,6 @@ test: install_deps
$(info ******************** running tests ********************)
richgo test -v ./...

cobra_generator: install_deps
$(info ******************** building generator ********************)
mkdir -p $(BIN)
make -C cobra all

install_deps:
$(info ******************** downloading dependencies ********************)
go get -v ./...
Expand Down
26 changes: 16 additions & 10 deletions README.md
@@ -1,6 +1,6 @@
![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)

Cobra is both a library for creating powerful modern CLI applications as well as a program to generate applications and command files.
Cobra is a library for creating powerful modern CLI applications.

Cobra is used in many Go projects such as [Kubernetes](http://kubernetes.io/),
[Hugo](https://gohugo.io), and [Github CLI](https://github.com/cli/cli) to
Expand All @@ -16,9 +16,6 @@ name a few. [This list](./projects_using_cobra.md) contains a more extensive lis
Cobra is a library providing a simple interface to create powerful modern CLI
interfaces similar to git & go tools.

Cobra is also an application that will generate your application scaffolding to rapidly
develop a Cobra-based application.

Cobra provides:
* Easy subcommand-based CLIs: `app server`, `app fetch`, etc.
* Fully POSIX-compliant flags (including short & long versions)
Expand All @@ -34,6 +31,7 @@ Cobra provides:
* The flexibility to define your own help, usage, etc.
* Optional seamless integration with [viper](http://github.com/spf13/viper) for 12-factor apps

# Cobra-CLI
# Concepts

Cobra is built on a structure of commands, arguments & flags.
Expand Down Expand Up @@ -83,10 +81,11 @@ which maintains the same interface while adding POSIX compliance.

# Installing
Using Cobra is easy. First, use `go get` to install the latest version
of the library. This command will install the `cobra` generator executable
along with the library and its dependencies:
of the library.

go get -u github.com/spf13/cobra
```
go get -u github.com/spf13/cobra@latest
```

Next, include Cobra in your application:

Expand All @@ -95,10 +94,17 @@ import "github.com/spf13/cobra"
```

# Usage
Cobra provides its own program that will create your application and add any
commands you want. It's the easiest way to incorporate Cobra into your application.
`cobra-cli` is a command line program to generate cobra applications and command files.
It will bootstrap your application scaffolding to rapidly
develop a Cobra-based application. It is the easiest way to incorporate Cobra into your application.

It can be installed by running:

```
go install github.com/spf13/cobra-cli@latest
```

For complete details on using the Cobra generator, please read [The Cobra Generator README](https://github.com/spf13/cobra/blob/master/cobra/README.md)
For complete details on using the Cobra-CLI generator, please read [The Cobra Generator README](https://github.com/spf13/cobra-cli/blob/master/README.md)

For complete details on using the Cobra library, please read the [The Cobra User Guide](user_guide.md).

Expand Down
23 changes: 0 additions & 23 deletions cobra/Makefile

This file was deleted.

179 changes: 0 additions & 179 deletions cobra/README.md

This file was deleted.

0 comments on commit 91749ca

Please sign in to comment.