github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/cmd/deletecmd/delete_git.go (about) 1 package deletecmd 2 3 import ( 4 "github.com/olli-ai/jx/v2/pkg/cmd/helper" 5 "github.com/olli-ai/jx/v2/pkg/cmd/opts" 6 "github.com/spf13/cobra" 7 ) 8 9 // DeleteGitOptions are the flags for delete commands 10 type DeleteGitOptions struct { 11 *opts.CommonOptions 12 } 13 14 // NewCmdDeleteGit creates a command object for the generic "get" action, which 15 // retrieves one or more resources from a server. 16 func NewCmdDeleteGit(commonOpts *opts.CommonOptions) *cobra.Command { 17 options := &DeleteGitOptions{ 18 commonOpts, 19 } 20 21 cmd := &cobra.Command{ 22 Use: "git", 23 Short: "Deletes one or more Git resources", 24 Run: func(cmd *cobra.Command, args []string) { 25 options.Cmd = cmd 26 options.Args = args 27 err := options.Run() 28 helper.CheckErr(err) 29 }, 30 SuggestFor: []string{"remove", "rm"}, 31 } 32 33 cmd.AddCommand(NewCmdDeleteGitServer(commonOpts)) 34 cmd.AddCommand(NewCmdDeleteGitToken(commonOpts)) 35 return cmd 36 } 37 38 // Run implements this command 39 func (o *DeleteGitOptions) Run() error { 40 return o.Cmd.Help() 41 }