func addPromote()

in pkg/kepctl/commands/promote.go [27:63]


func addPromote(topLevel *cobra.Command) {
	po := proposal.PromoteOpts{}

	cmd := &cobra.Command{
		Use:           "promote [KEP]",
		Short:         "Promote a KEP",
		Long:          "Promote a KEP to a new stage for a target release",
		Example:       `  kepctl promote sig-architecture/000-mykep --stage beta --release v1.20`,
		SilenceUsage:  true,
		SilenceErrors: true,
		PreRunE: func(cmd *cobra.Command, args []string) error {
			return po.Validate(args)
		},
		RunE: func(*cobra.Command, []string) error {
			return runPromote(&po)
		},
	}

	// TODO: Should these all be global args?
	cmd.PersistentFlags().StringVarP(
		&po.Stage,
		"stage",
		"s",
		"",
		"KEP Stage",
	)

	cmd.PersistentFlags().StringVarP(
		&po.Release,
		"release",
		"r",
		"",
		"Target Release",
	)

	topLevel.AddCommand(cmd)
}