cli/pkg/cmd/repo/repo.go
Nate Smith 9f486efbc6
hackday: gh repo garden (#1049)
* add gh repo garden

* move file

* oops

* fixes

* fix clearing

* block windows sadly

* broken wip

* fix api thing

* do not add to client

* move helper as it does not work on windows

* hide command

* macos fix

* Update pkg/cmd/repo/garden/garden.go

Co-authored-by: Lee Reilly <lee@github.com>

* default for key input loop

* get redrawing working

* clean up garden update, it all works

* notes

* fix arrow keys and just do wads/arrows/vi

* this function is only called once now

* support ghes

* add a progress indicator

* cap maxCommits

Co-authored-by: Lee Reilly <lee@github.com>
2020-09-15 09:59:27 -05:00

43 lines
1.3 KiB
Go

package repo
import (
"github.com/MakeNowJust/heredoc"
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"
repoForkCmd "github.com/cli/cli/pkg/cmd/repo/fork"
gardenCmd "github.com/cli/cli/pkg/cmd/repo/garden"
repoViewCmd "github.com/cli/cli/pkg/cmd/repo/view"
"github.com/cli/cli/pkg/cmdutil"
"github.com/spf13/cobra"
)
func NewCmdRepo(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "repo <command>",
Short: "Create, clone, fork, and view repositories",
Long: `Work with GitHub repositories`,
Example: heredoc.Doc(`
$ gh repo create
$ gh repo clone cli/cli
$ gh repo view --web
`),
Annotations: map[string]string{
"IsCore": "true",
"help:arguments": heredoc.Doc(`
A repository can be supplied as an argument in any of the following formats:
- "OWNER/REPO"
- by URL, e.g. "https://github.com/OWNER/REPO"
`),
},
}
cmd.AddCommand(repoViewCmd.NewCmdView(f, nil))
cmd.AddCommand(repoForkCmd.NewCmdFork(f, nil))
cmd.AddCommand(repoCloneCmd.NewCmdClone(f, nil))
cmd.AddCommand(repoCreateCmd.NewCmdCreate(f, nil))
cmd.AddCommand(creditsCmd.NewCmdRepoCredits(f, nil))
cmd.AddCommand(gardenCmd.NewCmdGarden(f, nil))
return cmd
}