github.com/jenkins-x/jx/v2@v2.1.155/pkg/cmd/deletecmd/delete_jenkins.go (about) 1 package deletecmd 2 3 import ( 4 "github.com/jenkins-x/jx/v2/pkg/cmd/helper" 5 "github.com/jenkins-x/jx/v2/pkg/cmd/opts" 6 "github.com/spf13/cobra" 7 ) 8 9 // DeleteJenkinsOptions are the flags for delete commands 10 type DeleteJenkinsOptions struct { 11 *opts.CommonOptions 12 } 13 14 // NewCmdDeleteJenkins creates a command object for the generic "get" action, which 15 // retrieves one or more resources from a server. 16 func NewCmdDeleteJenkins(commonOpts *opts.CommonOptions) *cobra.Command { 17 options := &DeleteJenkinsOptions{ 18 commonOpts, 19 } 20 21 cmd := &cobra.Command{ 22 Use: "jenkins", 23 Short: "Deletes one or more Jenkins 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(NewCmdDeleteJenkinsToken(commonOpts)) 34 return cmd 35 } 36 37 // Run implements this command 38 func (o *DeleteJenkinsOptions) Run() error { 39 return o.Cmd.Help() 40 }