github.com/ungtb10d/cli/v2@v2.0.0-20221110210412-98537dd9d6a1/pkg/cmd/gist/gist.go (about) 1 package gist 2 3 import ( 4 "github.com/MakeNowJust/heredoc" 5 gistCloneCmd "github.com/ungtb10d/cli/v2/pkg/cmd/gist/clone" 6 gistCreateCmd "github.com/ungtb10d/cli/v2/pkg/cmd/gist/create" 7 gistDeleteCmd "github.com/ungtb10d/cli/v2/pkg/cmd/gist/delete" 8 gistEditCmd "github.com/ungtb10d/cli/v2/pkg/cmd/gist/edit" 9 gistListCmd "github.com/ungtb10d/cli/v2/pkg/cmd/gist/list" 10 gistViewCmd "github.com/ungtb10d/cli/v2/pkg/cmd/gist/view" 11 "github.com/ungtb10d/cli/v2/pkg/cmdutil" 12 "github.com/spf13/cobra" 13 ) 14 15 func NewCmdGist(f *cmdutil.Factory) *cobra.Command { 16 cmd := &cobra.Command{ 17 Use: "gist <command>", 18 Short: "Manage gists", 19 Long: `Work with GitHub gists.`, 20 Annotations: map[string]string{ 21 "IsCore": "true", 22 "help:arguments": heredoc.Doc(` 23 A gist can be supplied as argument in either of the following formats: 24 - by ID, e.g. 5b0e0062eb8e9654adad7bb1d81cc75f 25 - by URL, e.g. "https://gist.github.com/OWNER/5b0e0062eb8e9654adad7bb1d81cc75f" 26 `), 27 }, 28 } 29 30 cmd.AddCommand(gistCloneCmd.NewCmdClone(f, nil)) 31 cmd.AddCommand(gistCreateCmd.NewCmdCreate(f, nil)) 32 cmd.AddCommand(gistListCmd.NewCmdList(f, nil)) 33 cmd.AddCommand(gistViewCmd.NewCmdView(f, nil)) 34 cmd.AddCommand(gistEditCmd.NewCmdEdit(f, nil)) 35 cmd.AddCommand(gistDeleteCmd.NewCmdDelete(f, nil)) 36 37 return cmd 38 }