Skip to content

Commit 5b2b9e9

Browse files
authored
Removes viper dependency by removing cobra/ CLI tool (#1604)
The cobra bootstrapping CLI tool has moved to https://github.com/spf13/cobra-cli Signed-off-by: John McBride <[email protected]>
1 parent 9369465 commit 5b2b9e9

34 files changed

+26
-4747
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
go install github.com/kyoh86/richgo"${_version}"
6262
go install github.com/mitchellh/gox"${_version}"
6363
64-
- run: PATH=$HOME/go/bin/:$PATH make test cobra_generator
64+
- run: PATH=$HOME/go/bin/:$PATH make test
6565

6666
test-win:
6767
name: MINGW64
@@ -97,4 +97,4 @@ jobs:
9797
go install github.com/kyoh86/richgo@latest
9898
go install github.com/mitchellh/gox@latest
9999
100-
- run: PATH=$HOME/go/bin:$PATH make test cobra_generator
100+
- run: PATH=$HOME/go/bin:$PATH make test

Makefile

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ ifeq (, $(shell which richgo))
99
$(warning "could not find richgo in $(PATH), run: go get github.com/kyoh86/richgo")
1010
endif
1111

12-
.PHONY: fmt lint test cobra_generator install_deps clean
12+
.PHONY: fmt lint test install_deps clean
1313

1414
default: all
1515

16-
all: fmt test cobra_generator
16+
all: fmt test
1717

1818
fmt:
1919
$(info ******************** checking formatting ********************)
@@ -27,11 +27,6 @@ test: install_deps
2727
$(info ******************** running tests ********************)
2828
richgo test -v ./...
2929

30-
cobra_generator: install_deps
31-
$(info ******************** building generator ********************)
32-
mkdir -p $(BIN)
33-
make -C cobra all
34-
3530
install_deps:
3631
$(info ******************** downloading dependencies ********************)
3732
go get -v ./...

README.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![cobra logo](https://cloud.githubusercontent.com/assets/173412/10886352/ad566232-814f-11e5-9cd0-aa101788c117.png)
22

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

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

19-
Cobra is also an application that will generate your application scaffolding to rapidly
20-
develop a Cobra-based application.
21-
2219
Cobra provides:
2320
* Easy subcommand-based CLIs: `app server`, `app fetch`, etc.
2421
* Fully POSIX-compliant flags (including short & long versions)
2522
* Nested subcommands
2623
* Global, local and cascading flags
27-
* Easy generation of applications & commands with `cobra init` & `cobra add cmdname`
2824
* Intelligent suggestions (`app srver`... did you mean `app server`?)
2925
* Automatic help generation for commands and flags
3026
* Automatic help flag recognition of `-h`, `--help`, etc.
@@ -83,10 +79,11 @@ which maintains the same interface while adding POSIX compliance.
8379

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

89-
go get -u github.com/spf13/cobra
84+
```
85+
go get -u github.com/spf13/cobra@latest
86+
```
9087

9188
Next, include Cobra in your application:
9289

@@ -95,10 +92,17 @@ import "github.com/spf13/cobra"
9592
```
9693

9794
# Usage
98-
Cobra provides its own program that will create your application and add any
99-
commands you want. It's the easiest way to incorporate Cobra into your application.
95+
`cobra-cli` is a command line program to generate cobra applications and command files.
96+
It will bootstrap your application scaffolding to rapidly
97+
develop a Cobra-based application. It is the easiest way to incorporate Cobra into your application.
98+
99+
It can be installed by running:
100+
101+
```
102+
go install github.com/spf13/cobra-cli@latest
103+
```
100104

101-
For complete details on using the Cobra generator, please read [The Cobra Generator README](https://github.com/spf13/cobra/blob/master/cobra/README.md)
105+
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)
102106

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

cobra/Makefile

Lines changed: 0 additions & 23 deletions
This file was deleted.

cobra/README.md

Lines changed: 0 additions & 179 deletions
This file was deleted.

0 commit comments

Comments
 (0)