forked from cli/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepo.go
More file actions
57 lines (53 loc) · 2.02 KB
/
repo.go
File metadata and controls
57 lines (53 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package repo
import (
"github.com/MakeNowJust/heredoc"
repoArchiveCmd "github.com/cli/cli/v2/pkg/cmd/repo/archive"
repoCloneCmd "github.com/cli/cli/v2/pkg/cmd/repo/clone"
repoCreateCmd "github.com/cli/cli/v2/pkg/cmd/repo/create"
creditsCmd "github.com/cli/cli/v2/pkg/cmd/repo/credits"
repoDeleteCmd "github.com/cli/cli/v2/pkg/cmd/repo/delete"
deployKeyCmd "github.com/cli/cli/v2/pkg/cmd/repo/deploy-key"
repoEditCmd "github.com/cli/cli/v2/pkg/cmd/repo/edit"
repoForkCmd "github.com/cli/cli/v2/pkg/cmd/repo/fork"
gardenCmd "github.com/cli/cli/v2/pkg/cmd/repo/garden"
repoListCmd "github.com/cli/cli/v2/pkg/cmd/repo/list"
repoRenameCmd "github.com/cli/cli/v2/pkg/cmd/repo/rename"
repoSyncCmd "github.com/cli/cli/v2/pkg/cmd/repo/sync"
repoViewCmd "github.com/cli/cli/v2/pkg/cmd/repo/view"
"github.com/cli/cli/v2/pkg/cmdutil"
"github.com/spf13/cobra"
)
func NewCmdRepo(f *cmdutil.Factory) *cobra.Command {
cmd := &cobra.Command{
Use: "repo <command>",
Short: "Manage 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(repoEditCmd.NewCmdEdit(f, nil))
cmd.AddCommand(repoListCmd.NewCmdList(f, nil))
cmd.AddCommand(repoSyncCmd.NewCmdSync(f, nil))
cmd.AddCommand(creditsCmd.NewCmdRepoCredits(f, nil))
cmd.AddCommand(gardenCmd.NewCmdGarden(f, nil))
cmd.AddCommand(deployKeyCmd.NewCmdDeployKey(f))
cmd.AddCommand(repoRenameCmd.NewCmdRename(f, nil))
cmd.AddCommand(repoDeleteCmd.NewCmdDelete(f, nil))
cmd.AddCommand(repoArchiveCmd.NewCmdArchive(f, nil))
return cmd
}