diff --git a/cobra/cmd/add.go b/cobra/cmd/add.go index 5cec1d04..c2d82ade 100644 --- a/cobra/cmd/add.go +++ b/cobra/cmd/add.go @@ -19,7 +19,7 @@ import ( "path/filepath" "unicode" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" ) func init() { @@ -71,7 +71,7 @@ Example: cobra add server -> resulting in a new cmd/server.go`, // 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/OneCloudInc/cobra/issues/269 func validateCmdName(source string) string { i := 0 l := len(source) @@ -130,7 +130,7 @@ package {{.cmdPackage}} import ( "fmt" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" ) {{ printFlagVars .flags }} diff --git a/cobra/cmd/init.go b/cobra/cmd/init.go index 9af76f3c..1f3c3ba2 100644 --- a/cobra/cmd/init.go +++ b/cobra/cmd/init.go @@ -19,7 +19,7 @@ import ( "path" "path/filepath" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" "github.com/spf13/viper" ) @@ -148,7 +148,7 @@ import ( "os" {{if .viper}} homedir "github.com/mitchellh/go-homedir"{{end}} - "github.com/spf13/cobra"{{if .viper}} + "github.com/OneCloudInc/cobra"{{if .viper}} "github.com/spf13/viper"{{end}} ){{if .viper}} diff --git a/cobra/cmd/project.go b/cobra/cmd/project.go index 7ddb8258..32a46648 100644 --- a/cobra/cmd/project.go +++ b/cobra/cmd/project.go @@ -114,7 +114,7 @@ func (p *Project) License() License { return p.license } -// Name returns the name of project, e.g. "github.com/spf13/cobra" +// Name returns the name of project, e.g. "github.com/OneCloudInc/cobra" func (p Project) Name() string { return p.name } diff --git a/cobra/cmd/project_test.go b/cobra/cmd/project_test.go index 037f7c55..fe23ba57 100644 --- a/cobra/cmd/project_test.go +++ b/cobra/cmd/project_test.go @@ -5,7 +5,7 @@ import ( ) func TestFindExistingPackage(t *testing.T) { - path := findPackage("github.com/spf13/cobra") + path := findPackage("github.com/OneCloudInc/cobra") if path == "" { t.Fatal("findPackage didn't find the existing package") } diff --git a/cobra/cmd/root.go b/cobra/cmd/root.go index 2220d498..504ffe36 100644 --- a/cobra/cmd/root.go +++ b/cobra/cmd/root.go @@ -16,8 +16,8 @@ package cmd import ( "fmt" + "github.com/OneCloudInc/cobra" homedir "github.com/mitchellh/go-homedir" - "github.com/spf13/cobra" "github.com/spf13/viper" ) diff --git a/cobra/cmd/testdata/root.go.golden b/cobra/cmd/testdata/root.go.golden index 015a15b9..2a878fee 100644 --- a/cobra/cmd/testdata/root.go.golden +++ b/cobra/cmd/testdata/root.go.golden @@ -18,7 +18,7 @@ import ( "fmt" "os" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" ) diff --git a/cobra/cmd/testdata/test.go.golden b/cobra/cmd/testdata/test.go.golden index 7c365ab6..57d0f079 100644 --- a/cobra/cmd/testdata/test.go.golden +++ b/cobra/cmd/testdata/test.go.golden @@ -17,7 +17,7 @@ package cmd import ( "fmt" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" ) diff --git a/command.go b/command.go index 7d5ba929..c678063e 100644 --- a/command.go +++ b/command.go @@ -1229,7 +1229,7 @@ func (c *Command) IsAvailableCommand() bool { // help topic command; additional help topic command is determined by the // fact that it is NOT runnable/hidden/deprecated, and has no sub commands that // are runnable/hidden/deprecated. -// Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924. +// Concrete example: https://github.com/OneCloudInc/cobra/issues/393#issuecomment-282741924. func (c *Command) IsAdditionalHelpTopicCommand() bool { // if a command is runnable, deprecated, or hidden it is not a 'help' command if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden { diff --git a/command_test.go b/command_test.go index 6e483a3e..c7c581fe 100644 --- a/command_test.go +++ b/command_test.go @@ -805,7 +805,7 @@ func TestHelpFlagExecutedOnChild(t *testing.T) { // TestHelpFlagInHelp checks, // if '--help' flag is shown in help for child (executing `parent help child`), // that has no other flags. -// Related to https://github.com/spf13/cobra/issues/302. +// Related to https://github.com/OneCloudInc/cobra/issues/302. func TestHelpFlagInHelp(t *testing.T) { parentCmd := &Command{Use: "parent", Run: func(*Command, []string) {}} @@ -1166,7 +1166,7 @@ func TestPersistentHooks(t *testing.T) { // TODO: currently PersistenPreRun* defined in parent does not // run if the matchin child subcommand has PersistenPreRun. - // If the behavior changes (https://github.com/spf13/cobra/issues/252) + // If the behavior changes (https://github.com/OneCloudInc/cobra/issues/252) // this test must be fixed. if parentPersPreArgs != "" { t.Errorf("Expected blank parentPersPreArgs, got %q", parentPersPreArgs) @@ -1182,7 +1182,7 @@ func TestPersistentHooks(t *testing.T) { } // TODO: currently PersistenPostRun* defined in parent does not // run if the matchin child subcommand has PersistenPostRun. - // If the behavior changes (https://github.com/spf13/cobra/issues/252) + // If the behavior changes (https://github.com/OneCloudInc/cobra/issues/252) // this test must be fixed. if parentPersPostArgs != "" { t.Errorf("Expected blank parentPersPostArgs, got %q", parentPersPostArgs) @@ -1205,7 +1205,7 @@ func TestPersistentHooks(t *testing.T) { } } -// Related to https://github.com/spf13/cobra/issues/521. +// Related to https://github.com/OneCloudInc/cobra/issues/521. func TestGlobalNormFuncPropagation(t *testing.T) { normFunc := func(f *pflag.FlagSet, name string) pflag.NormalizedName { return pflag.NormalizedName(name) @@ -1225,7 +1225,7 @@ func TestGlobalNormFuncPropagation(t *testing.T) { } } -// Related to https://github.com/spf13/cobra/issues/521. +// Related to https://github.com/OneCloudInc/cobra/issues/521. func TestNormPassedOnLocal(t *testing.T) { toUpper := func(f *pflag.FlagSet, name string) pflag.NormalizedName { return pflag.NormalizedName(strings.ToUpper(name)) @@ -1239,7 +1239,7 @@ func TestNormPassedOnLocal(t *testing.T) { } } -// Related to https://github.com/spf13/cobra/issues/521. +// Related to https://github.com/OneCloudInc/cobra/issues/521. func TestNormPassedOnInherited(t *testing.T) { toUpper := func(f *pflag.FlagSet, name string) pflag.NormalizedName { return pflag.NormalizedName(strings.ToUpper(name)) @@ -1267,7 +1267,7 @@ func TestNormPassedOnInherited(t *testing.T) { } } -// Related to https://github.com/spf13/cobra/issues/521. +// Related to https://github.com/OneCloudInc/cobra/issues/521. func TestConsistentNormalizedName(t *testing.T) { toUpper := func(f *pflag.FlagSet, name string) pflag.NormalizedName { return pflag.NormalizedName(strings.ToUpper(name)) @@ -1400,7 +1400,7 @@ func TestFlagErrorFunc(t *testing.T) { // TestSortedFlags checks, // if cmd.LocalFlags() is unsorted when cmd.Flags().SortFlags set to false. -// Related to https://github.com/spf13/cobra/issues/404. +// Related to https://github.com/OneCloudInc/cobra/issues/404. func TestSortedFlags(t *testing.T) { c := &Command{} c.Flags().SortFlags = false @@ -1426,7 +1426,7 @@ func TestSortedFlags(t *testing.T) { // TestMergeCommandLineToFlags checks, // if pflag.CommandLine is correctly merged to c.Flags() after first call // of c.mergePersistentFlags. -// Related to https://github.com/spf13/cobra/issues/443. +// Related to https://github.com/OneCloudInc/cobra/issues/443. func TestMergeCommandLineToFlags(t *testing.T) { pflag.Bool("boolflag", false, "") c := &Command{Use: "c", Run: emptyRun} @@ -1440,7 +1440,7 @@ func TestMergeCommandLineToFlags(t *testing.T) { // TestUseDeprecatedFlags checks, // if cobra.Execute() prints a message, if a deprecated flag is used. -// Related to https://github.com/spf13/cobra/issues/463. +// Related to https://github.com/OneCloudInc/cobra/issues/463. func TestUseDeprecatedFlags(t *testing.T) { c := &Command{Use: "c", Run: emptyRun} c.Flags().BoolP("deprecated", "d", false, "deprecated flag") @@ -1555,7 +1555,7 @@ func TestTraverseWithTwoSubcommands(t *testing.T) { } // TestUpdateName checks if c.Name() updates on changed c.Use. -// Related to https://github.com/spf13/cobra/pull/422#discussion_r143918343. +// Related to https://github.com/OneCloudInc/cobra/pull/422#discussion_r143918343. func TestUpdateName(t *testing.T) { c := &Command{Use: "name xyz"} originalName := c.Name() diff --git a/doc/cmd_test.go b/doc/cmd_test.go index d29c577d..d0847567 100644 --- a/doc/cmd_test.go +++ b/doc/cmd_test.go @@ -4,7 +4,7 @@ import ( "strings" "testing" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" ) func emptyRun(*cobra.Command, []string) {} diff --git a/doc/man_docs.go b/doc/man_docs.go index 4a062339..87beda7f 100644 --- a/doc/man_docs.go +++ b/doc/man_docs.go @@ -24,8 +24,8 @@ import ( "strings" "time" + "github.com/OneCloudInc/cobra" "github.com/cpuguy83/go-md2man/md2man" - "github.com/spf13/cobra" "github.com/spf13/pflag" ) diff --git a/doc/man_docs.md b/doc/man_docs.md index 3709160f..5caeed33 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/OneCloudInc/cobra" + "github.com/OneCloudInc/cobra/doc" ) func main() { diff --git a/doc/man_docs_test.go b/doc/man_docs_test.go index 2c400f5d..babf12f1 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/OneCloudInc/cobra" ) func translate(in string) string { diff --git a/doc/man_examples_test.go b/doc/man_examples_test.go index db660426..36fc2cf3 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/OneCloudInc/cobra" + "github.com/OneCloudInc/cobra/doc" ) func ExampleGenManTree() { diff --git a/doc/md_docs.go b/doc/md_docs.go index d76f6d5e..9c3648f0 100644 --- a/doc/md_docs.go +++ b/doc/md_docs.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/spf13/cobra" + "github.com/OneCloudInc/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 56ce9fe8..f69bad22 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/OneCloudInc/cobra" + "github.com/OneCloudInc/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/OneCloudInc/cobra/doc" ) func main() { diff --git a/doc/md_docs_test.go b/doc/md_docs_test.go index c060f32f..bf4b69c2 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/OneCloudInc/cobra" ) func TestGenMdDoc(t *testing.T) { diff --git a/doc/rest_docs.go b/doc/rest_docs.go index 051d8dc8..de531742 100644 --- a/doc/rest_docs.go +++ b/doc/rest_docs.go @@ -23,7 +23,7 @@ import ( "strings" "time" - "github.com/spf13/cobra" + "github.com/OneCloudInc/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 6098430e..75b89d97 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/OneCloudInc/cobra" + "github.com/OneCloudInc/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/OneCloudInc/cobra/doc" ) func main() { diff --git a/doc/rest_docs_test.go b/doc/rest_docs_test.go index 330a2e5e..deabf64d 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/OneCloudInc/cobra" ) func TestGenRSTDoc(t *testing.T) { diff --git a/doc/util.go b/doc/util.go index 8d3dbece..f27e158d 100644 --- a/doc/util.go +++ b/doc/util.go @@ -16,7 +16,7 @@ package doc import ( "strings" - "github.com/spf13/cobra" + "github.com/OneCloudInc/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 ea00af07..e9b04df1 100644 --- a/doc/yaml_docs.go +++ b/doc/yaml_docs.go @@ -21,7 +21,7 @@ import ( "sort" "strings" - "github.com/spf13/cobra" + "github.com/OneCloudInc/cobra" "github.com/spf13/pflag" "gopkg.in/yaml.v2" ) diff --git a/doc/yaml_docs.md b/doc/yaml_docs.md index 1a9b7c6a..f229e034 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/OneCloudInc/cobra" + "github.com/OneCloudInc/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/OneCloudInc/cobra/doc" ) func main() { diff --git a/doc/yaml_docs_test.go b/doc/yaml_docs_test.go index c5a63594..db775ef7 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/OneCloudInc/cobra" ) func TestGenYamlDoc(t *testing.T) { diff --git a/go.mod b/go.mod index 1b7132d6..e782f3c8 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,6 @@ require ( github.com/russross/blackfriday v1.5.2 // indirect github.com/spf13/afero v1.2.1 // indirect github.com/spf13/cast v1.3.0 // indirect - github.com/spf13/cobra v0.0.3 github.com/spf13/jwalterweatherman v1.0.0 // indirect github.com/spf13/pflag v1.0.3 github.com/spf13/viper v1.3.1