github.com/jenkins-x/jx/v2@v2.1.155/pkg/cmd/step/post/step_post.go (about) 1 package post 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 // GetOptions is the start of the data required to perform the operation. As new fields are added, add them here instead of 10 // referencing the cmd.Flags() 11 type StepPostOptions struct { 12 *opts.CommonOptions 13 14 DisableImport bool 15 OutDir string 16 } 17 18 // NewCmdStep Steps a command object for the "step" command 19 func NewCmdStepPost(commonOpts *opts.CommonOptions) *cobra.Command { 20 options := &StepPostOptions{ 21 CommonOptions: commonOpts, 22 } 23 24 cmd := &cobra.Command{ 25 Use: "post", 26 Short: "post step actions", 27 Run: func(cmd *cobra.Command, args []string) { 28 options.Cmd = cmd 29 options.Args = args 30 err := options.Run() 31 helper.CheckErr(err) 32 }, 33 } 34 35 cmd.AddCommand(NewCmdStepPostBuild(commonOpts)) 36 cmd.AddCommand(NewCmdStepPostInstall(commonOpts)) 37 cmd.AddCommand(NewCmdStepPostRun(commonOpts)) 38 39 return cmd 40 } 41 42 // Run implements this command 43 func (o *StepPostOptions) Run() error { 44 return o.Cmd.Help() 45 }