From 2038338527bb2a10409f63bcc779535e337e447f Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 19 Mar 2019 01:32:43 +0100 Subject: [PATCH] fork spf13/cobra to umarcor/cobra --- README.md | 22 ++++++++++------------ cobra/cmd/add.go | 4 ++-- cobra/cmd/init.go | 2 +- cobra/cmd/project.go | 2 +- cobra/cmd/root.go | 2 +- cobra/cmd/testdata/root.go.golden | 3 +-- cobra/main.go | 2 +- cobra/tpl/main.go | 2 +- doc/cmd_test.go | 2 +- doc/man_docs.go | 8 ++++---- doc/man_docs.md | 4 ++-- doc/man_docs_test.go | 2 +- doc/man_examples_test.go | 4 ++-- doc/md_docs.go | 2 +- doc/md_docs.md | 6 +++--- doc/md_docs_test.go | 2 +- doc/rest_docs.go | 2 +- doc/rest_docs.md | 6 +++--- doc/rest_docs_test.go | 2 +- doc/util.go | 2 +- doc/yaml_docs.go | 2 +- doc/yaml_docs.md | 6 +++--- doc/yaml_docs_test.go | 2 +- go.mod | 2 +- 24 files changed, 45 insertions(+), 48 deletions(-) diff --git a/README.md b/README.md index 1586e8c8ef..702b217515 100644 --- a/README.md +++ b/README.md @@ -27,9 +27,7 @@ Many of the most widely used Go projects are built using Cobra, such as: [Linkerd](https://linkerd.io/), 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) -[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) +[![GoDoc](https://godoc.org/github.com/umarcor/cobra?status.svg)](https://godoc.org/github.com/umarcor/cobra) # Table of Contents @@ -109,7 +107,7 @@ have children commands and optionally run an action. In the example above, 'server' is the command. -[More about cobra.Command](https://godoc.org/github.com/spf13/cobra#Command) +[More about cobra.Command](https://godoc.org/github.com/umarcor/cobra#Command) ## Flags @@ -129,12 +127,12 @@ 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: - go get -u github.com/spf13/cobra/cobra + go get -u github.com/umarcor/cobra/cobra Next, include Cobra in your application: ```go -import "github.com/spf13/cobra" +import "github.com/umarcor/cobra" ``` # Getting Started @@ -171,7 +169,7 @@ func main() { 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. -[Here](https://github.com/spf13/cobra/blob/master/cobra/README.md) you can find more information about it. +[Here](https://github.com/umarcor/cobra/blob/master/cobra/README.md) you can find more information about it. ## Using the Cobra Library @@ -214,7 +212,7 @@ import ( "os" homedir "github.com/mitchellh/go-homedir" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" "github.com/spf13/viper" ) @@ -292,7 +290,7 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func init() { @@ -443,7 +441,7 @@ import ( "fmt" "strings" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func main() { @@ -610,7 +608,7 @@ package main import ( "fmt" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func main() { @@ -746,4 +744,4 @@ Cobra can generate zsh-completion file. Read more about it in # License -Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/spf13/cobra/blob/master/LICENSE.txt) +Cobra is released under the Apache 2.0 license. See [LICENSE.txt](https://github.com/umarcor/cobra/blob/master/LICENSE.txt) diff --git a/cobra/cmd/add.go b/cobra/cmd/add.go index 6645a755f0..dec1b74ba9 100644 --- a/cobra/cmd/add.go +++ b/cobra/cmd/add.go @@ -18,7 +18,7 @@ import ( "os" "unicode" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) var ( @@ -78,7 +78,7 @@ func init() { // validateCmdName returns source without any dashes and underscore. // If there will be dash or underscore, next letter will be uppered. // It supports only ASCII (1-byte character) strings. -// https://github.com/spf13/cobra/issues/269 +// https://github.com/umarcor/cobra/issues/269 func validateCmdName(source string) string { i := 0 l := len(source) diff --git a/cobra/cmd/init.go b/cobra/cmd/init.go index dcf5ada4fb..e3592f9176 100644 --- a/cobra/cmd/init.go +++ b/cobra/cmd/init.go @@ -18,8 +18,8 @@ import ( "os" "path" - "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/umarcor/cobra" ) var ( diff --git a/cobra/cmd/project.go b/cobra/cmd/project.go index ecd783d030..18ea84c7ec 100644 --- a/cobra/cmd/project.go +++ b/cobra/cmd/project.go @@ -5,7 +5,7 @@ import ( "os" "text/template" - "github.com/spf13/cobra/cobra/tpl" + "github.com/umarcor/cobra/cobra/tpl" ) // Project contains name, license and paths to projects. diff --git a/cobra/cmd/root.go b/cobra/cmd/root.go index 97f404bbb6..1e85662a1e 100644 --- a/cobra/cmd/root.go +++ b/cobra/cmd/root.go @@ -17,8 +17,8 @@ import ( "fmt" homedir "github.com/mitchellh/go-homedir" - "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/umarcor/cobra" ) var ( diff --git a/cobra/cmd/testdata/root.go.golden b/cobra/cmd/testdata/root.go.golden index 938933c270..014afcb2f0 100644 --- a/cobra/cmd/testdata/root.go.golden +++ b/cobra/cmd/testdata/root.go.golden @@ -18,11 +18,10 @@ package cmd import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" homedir "github.com/mitchellh/go-homedir" "github.com/spf13/viper" - ) diff --git a/cobra/main.go b/cobra/main.go index eeaf9824ef..77258ecf3a 100644 --- a/cobra/main.go +++ b/cobra/main.go @@ -16,7 +16,7 @@ package main import ( "os" - "github.com/spf13/cobra/cobra/cmd" + "github.com/umarcor/cobra/cobra/cmd" ) func main() { diff --git a/cobra/tpl/main.go b/cobra/tpl/main.go index 2eab47eaaf..7bdeda4e1a 100644 --- a/cobra/tpl/main.go +++ b/cobra/tpl/main.go @@ -25,7 +25,7 @@ package cmd import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" {{ if .Viper }} homedir "github.com/mitchellh/go-homedir" "github.com/spf13/viper" diff --git a/doc/cmd_test.go b/doc/cmd_test.go index d29c577df8..cd869cbddb 100644 --- a/doc/cmd_test.go +++ b/doc/cmd_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func emptyRun(*cobra.Command, []string) {} diff --git a/doc/man_docs.go b/doc/man_docs.go index 4a0623393f..c9d4a67f82 100644 --- a/doc/man_docs.go +++ b/doc/man_docs.go @@ -25,8 +25,8 @@ import ( "time" "github.com/cpuguy83/go-md2man/md2man" - "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/umarcor/cobra" ) // GenManTree will generate a man page for this command and all descendants @@ -88,7 +88,7 @@ type GenManTreeOptions struct { // GenManHeader is a lot like the .TH header at the start of man pages. These // include the title, section, date, source, and manual. We will use the -// current time if Date is unset and will use "Auto generated by spf13/cobra" +// current time if Date is unset and will use "Auto generated by umarcor/cobra" // if the Source is unset. type GenManHeader struct { Title string @@ -134,7 +134,7 @@ func fillHeader(header *GenManHeader, name string) error { } header.date = (*header.Date).Format("Jan 2006") if header.Source == "" { - header.Source = "Auto generated by spf13/cobra" + header.Source = "Auto generated by umarcor/cobra" } return nil } @@ -241,7 +241,7 @@ func genMan(cmd *cobra.Command, header *GenManHeader) []byte { buf.WriteString(strings.Join(seealsos, ", ") + "\n") } if !cmd.DisableAutoGenTag { - buf.WriteString(fmt.Sprintf("# HISTORY\n%s Auto generated by spf13/cobra\n", header.Date.Format("2-Jan-2006"))) + buf.WriteString(fmt.Sprintf("# HISTORY\n%s Auto generated by umarcor/cobra\n", header.Date.Format("2-Jan-2006"))) } return buf.Bytes() } diff --git a/doc/man_docs.md b/doc/man_docs.md index 3709160f34..b9f2331625 100644 --- a/doc/man_docs.md +++ b/doc/man_docs.md @@ -8,8 +8,8 @@ package main import ( "log" - "github.com/spf13/cobra" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra" + "github.com/umarcor/cobra/doc" ) func main() { diff --git a/doc/man_docs_test.go b/doc/man_docs_test.go index 2c400f5df7..8fe7803e4d 100644 --- a/doc/man_docs_test.go +++ b/doc/man_docs_test.go @@ -10,7 +10,7 @@ import ( "strings" "testing" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func translate(in string) string { diff --git a/doc/man_examples_test.go b/doc/man_examples_test.go index db6604268a..16ad2cb357 100644 --- a/doc/man_examples_test.go +++ b/doc/man_examples_test.go @@ -4,8 +4,8 @@ import ( "bytes" "fmt" - "github.com/spf13/cobra" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra" + "github.com/umarcor/cobra/doc" ) func ExampleGenManTree() { diff --git a/doc/md_docs.go b/doc/md_docs.go index d76f6d5ecb..89ef7261cc 100644 --- a/doc/md_docs.go +++ b/doc/md_docs.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func printOptions(buf *bytes.Buffer, cmd *cobra.Command, name string) error { diff --git a/doc/md_docs.md b/doc/md_docs.md index 56ce9fe819..8d595c9e96 100644 --- a/doc/md_docs.md +++ b/doc/md_docs.md @@ -8,8 +8,8 @@ package main import ( "log" - "github.com/spf13/cobra" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra" + "github.com/umarcor/cobra/doc" ) func main() { @@ -41,7 +41,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/cmd" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra/doc" ) func main() { diff --git a/doc/md_docs_test.go b/doc/md_docs_test.go index c060f32f78..c4a9ae7db7 100644 --- a/doc/md_docs_test.go +++ b/doc/md_docs_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func TestGenMdDoc(t *testing.T) { diff --git a/doc/rest_docs.go b/doc/rest_docs.go index 051d8dc832..d9bf92db42 100644 --- a/doc/rest_docs.go +++ b/doc/rest_docs.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func printOptionsReST(buf *bytes.Buffer, cmd *cobra.Command, name string) error { diff --git a/doc/rest_docs.md b/doc/rest_docs.md index 6098430eff..0f22e3e898 100644 --- a/doc/rest_docs.md +++ b/doc/rest_docs.md @@ -8,8 +8,8 @@ package main import ( "log" - "github.com/spf13/cobra" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra" + "github.com/umarcor/cobra/doc" ) func main() { @@ -41,7 +41,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/cmd" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra/doc" ) func main() { diff --git a/doc/rest_docs_test.go b/doc/rest_docs_test.go index 330a2e5e70..ecfb27f2a1 100644 --- a/doc/rest_docs_test.go +++ b/doc/rest_docs_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func TestGenRSTDoc(t *testing.T) { diff --git a/doc/util.go b/doc/util.go index 8d3dbecec8..860d708d63 100644 --- a/doc/util.go +++ b/doc/util.go @@ -16,7 +16,7 @@ package doc import ( "strings" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) // Test to see if we have a reason to print See Also information in docs diff --git a/doc/yaml_docs.go b/doc/yaml_docs.go index ea00af07e8..3559f26cff 100644 --- a/doc/yaml_docs.go +++ b/doc/yaml_docs.go @@ -21,8 +21,8 @@ import ( "sort" "strings" - "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/umarcor/cobra" "gopkg.in/yaml.v2" ) diff --git a/doc/yaml_docs.md b/doc/yaml_docs.md index 1a9b7c6a3c..70980143dd 100644 --- a/doc/yaml_docs.md +++ b/doc/yaml_docs.md @@ -8,8 +8,8 @@ package main import ( "log" - "github.com/spf13/cobra" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra" + "github.com/umarcor/cobra/doc" ) func main() { @@ -41,7 +41,7 @@ import ( "k8s.io/kubernetes/pkg/kubectl/cmd" cmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util" - "github.com/spf13/cobra/doc" + "github.com/umarcor/cobra/doc" ) func main() { diff --git a/doc/yaml_docs_test.go b/doc/yaml_docs_test.go index c5a63594f4..4f2588b0b7 100644 --- a/doc/yaml_docs_test.go +++ b/doc/yaml_docs_test.go @@ -7,7 +7,7 @@ import ( "path/filepath" "testing" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func TestGenYamlDoc(t *testing.T) { diff --git a/go.mod b/go.mod index 60aa6f64f3..aa92fca3c8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/spf13/cobra +module github.com/umarcor/cobra go 1.12