INNER CODE UNIT · Go

NormalizeCommand

kptdev/kpt · commands/commands.go:29

func NormalizeCommand(c ...*cobra.Command) {
	for _, cmd := range c {
		cmd.Short = strings.TrimPrefix(cmd.Short, "[Alpha] ")
		NormalizeCommand(cmd.Commands()...)
	}
}

// GetKptCommands returns the set of kpt commands to be registered
func GetKptCommands(ctx context.Context, name, version string) []*cobra.Command {
	var c []*cobra.Command
	fnCmd := fn.GetCommand(ctx, name)
	pkgCmd := pkg.GetCommand(ctx, name)
	liveCmd := live.GetCommand(ctx, name, version)
	alphaCmd := alpha.GetCommand(ctx, name, version)

	c = append(c, pkgCmd, fnCmd, liveCmd, alphaCmd)

	// apply cross-cutting issues to commands

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…