github.com/olli-ai/jx/v2@v2.0.400-0.20210921045218-14731b4dd448/pkg/cmd/step/boot/step_boot.go (about)

     1  package boot
     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/olli-ai/jx/v2/pkg/cmd/opts/step"
     7  	"github.com/spf13/cobra"
     8  )
     9  
    10  // StepBootOptions contains the command line flags
    11  type StepBootOptions struct {
    12  	step.StepOptions
    13  }
    14  
    15  // NewCmdStepBoot Steps a command object for the "step" command
    16  func NewCmdStepBoot(commonOpts *opts.CommonOptions) *cobra.Command {
    17  	options := &StepBootOptions{
    18  		StepOptions: step.StepOptions{
    19  			CommonOptions: commonOpts,
    20  		},
    21  	}
    22  
    23  	cmd := &cobra.Command{
    24  		Use:     "boot",
    25  		Short:   "boot [command]",
    26  		Aliases: []string{},
    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  	cmd.AddCommand(NewCmdStepBootVault(commonOpts))
    35  	return cmd
    36  }
    37  
    38  // Run implements this command
    39  func (o *StepBootOptions) Run() error {
    40  	return o.Cmd.Help()
    41  }