diff --git a/command/root.go b/command/root.go index be2368036..324da4486 100644 --- a/command/root.go +++ b/command/root.go @@ -21,6 +21,7 @@ import ( "github.com/cli/cli/internal/run" apiCmd "github.com/cli/cli/pkg/cmd/api" gistCreateCmd "github.com/cli/cli/pkg/cmd/gist/create" + repoCmd "github.com/cli/cli/pkg/cmd/repo" repoCloneCmd "github.com/cli/cli/pkg/cmd/repo/clone" repoCreateCmd "github.com/cli/cli/pkg/cmd/repo/create" creditsCmd "github.com/cli/cli/pkg/cmd/repo/credits" @@ -152,12 +153,12 @@ func init() { repoResolvingCmdFactory.BaseRepo = resolvedBaseRepo - RootCmd.AddCommand(repoCmd) - repoCmd.AddCommand(repoViewCmd.NewCmdView(&repoResolvingCmdFactory, nil)) - repoCmd.AddCommand(repoForkCmd.NewCmdFork(&repoResolvingCmdFactory, nil)) - repoCmd.AddCommand(repoCloneCmd.NewCmdClone(cmdFactory, nil)) - repoCmd.AddCommand(repoCreateCmd.NewCmdCreate(cmdFactory, nil)) - repoCmd.AddCommand(creditsCmd.NewCmdRepoCredits(&repoResolvingCmdFactory, nil)) + RootCmd.AddCommand(repoCmd.Cmd) + repoCmd.Cmd.AddCommand(repoViewCmd.NewCmdView(&repoResolvingCmdFactory, nil)) + repoCmd.Cmd.AddCommand(repoForkCmd.NewCmdFork(&repoResolvingCmdFactory, nil)) + repoCmd.Cmd.AddCommand(repoCloneCmd.NewCmdClone(cmdFactory, nil)) + repoCmd.Cmd.AddCommand(repoCreateCmd.NewCmdCreate(cmdFactory, nil)) + repoCmd.Cmd.AddCommand(creditsCmd.NewCmdRepoCredits(&repoResolvingCmdFactory, nil)) RootCmd.AddCommand(creditsCmd.NewCmdCredits(cmdFactory, nil)) } diff --git a/command/repo.go b/pkg/cmd/repo/repo.go similarity index 91% rename from command/repo.go rename to pkg/cmd/repo/repo.go index b4fcf4e7b..7de2e3ee7 100644 --- a/command/repo.go +++ b/pkg/cmd/repo/repo.go @@ -1,11 +1,11 @@ -package command +package repo import ( "github.com/MakeNowJust/heredoc" "github.com/spf13/cobra" ) -var repoCmd = &cobra.Command{ +var Cmd = &cobra.Command{ Use: "repo ", Short: "Create, clone, fork, and view repositories", Long: `Work with GitHub repositories`,