From b12cd4600725914f09413403f9ddf7cb8691ac7b 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 | 23 +++++++++++------------ cobra/add.go | 4 ++-- cobra/init.go | 2 +- cobra/main.go | 2 +- cobra/project.go | 2 +- doc/cmd_test.go | 2 +- doc/man_docs.go | 10 +++++----- 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 +- 21 files changed, 44 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 2e0e85327..106377246 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,8 @@ 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 name a few. [This list](./projects_using_cobra.md) contains a more extensive list of projects using Cobra. -[![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra) -[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra) -[![Go Report Card](https://goreportcard.com/badge/github.com/spf13/cobra)](https://goreportcard.com/report/github.com/spf13/cobra) +[![GoDoc](https://godoc.org/github.com/umarcor/cobra?status.svg)](https://godoc.org/github.com/umarcor/cobra) +[![Go Report Card](https://goreportcard.com/badge/github.com/umarcor/cobra)](https://goreportcard.com/report/github.com/umarcor/cobra) # Table of Contents @@ -87,7 +86,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 @@ -107,12 +106,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 @@ -149,7 +148,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 @@ -193,7 +192,7 @@ import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" "github.com/spf13/viper" ) @@ -293,7 +292,7 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func init() { @@ -444,7 +443,7 @@ import ( "fmt" "strings" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func main() { @@ -611,7 +610,7 @@ package main import ( "fmt" - "github.com/spf13/cobra" + "github.com/umarcor/cobra" ) func main() { @@ -738,4 +737,4 @@ Cobra can generate a shell-completion file for the following shells: Bash, Zsh, # 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/add.go b/cobra/add.go index 7303d08c1..48a1d2ecc 100644 --- a/cobra/add.go +++ b/cobra/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/init.go b/cobra/init.go index bfe2dd872..011eaa9f2 100644 --- a/cobra/init.go +++ b/cobra/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/main.go b/cobra/main.go index 53a263e54..13da0d37b 100644 --- a/cobra/main.go +++ b/cobra/main.go @@ -17,8 +17,8 @@ import ( "fmt" "os" - "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/umarcor/cobra" ) func main() { diff --git a/cobra/project.go b/cobra/project.go index 1695aed4c..adcb75c28 100644 --- a/cobra/project.go +++ b/cobra/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/doc/cmd_test.go b/doc/cmd_test.go index d29c577df..cd869cbdd 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 d384f8259..9fca547dd 100644 --- a/doc/man_docs.go +++ b/doc/man_docs.go @@ -24,9 +24,9 @@ import ( "strings" "time" - "github.com/cpuguy83/go-md2man/v2/md2man" - "github.com/spf13/cobra" + "github.com/cpuguy83/go-md2man/md2man" "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, disableAutoGen bool) error { } header.date = (*header.Date).Format("Jan 2006") if header.Source == "" && !disableAutoGen { - 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 3709160f3..b9f233162 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 85b028b3c..34922cfa4 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 58dee8a8c..52a964ab5 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 er(msg interface{}) { diff --git a/doc/md_docs.go b/doc/md_docs.go index d76f6d5ec..89ef7261c 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 5c870625f..b901ce659 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 c060f32f7..c4a9ae7db 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 051d8dc83..d9bf92db4 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 6098430ef..0f22e3e89 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 330a2e5e7..ecfb27f2a 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 584780694..f57f97d29 100644 --- a/doc/util.go +++ b/doc/util.go @@ -17,7 +17,7 @@ import ( "io" "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 96e6ad721..d1cc93b76 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 1a9b7c6a3..70980143d 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 d08fa4f82..595476ac3 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 a9d04ae5d..8ab7a7112 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/spf13/cobra +module github.com/umarcor/cobra go 1.12