cmd

package
v0.5.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "kcp",
	Short: "A CLI tool for kafka cluster planning and migration",
	Long:  "A comprehensive CLI tool for planning and executing kafka cluster migrations to confluent cloud. Docs: " + getDocURL(),
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if build_info.Version == "dev" {
			fmt.Printf("\n%s\n%s\n%s\n%s\n\n",
				color.RedString("┌─────────────────────────────────────────────────────────────────────────┐"),
				color.RedString("│ ⚠️  WARNING: This is a development build                                │"),
				color.RedString("│ Official releases: https://github.com/confluentinc/kcp/releases         │"),
				color.RedString("└─────────────────────────────────────────────────────────────────────────┘"))
		}

		fmt.Printf("%s %s %s %s\n",
			color.CyanString("Executing kcp with build"),
			color.GreenString("version=%s", build_info.Version),
			color.YellowString("commit=%s", build_info.Commit),
			color.BlueString("date=%s", build_info.Date))

		if err := checkWritePermissions(); err != nil {
			fmt.Fprintf(os.Stderr, "%s\n", color.RedString("Error: %v", err))
			os.Exit(1)
		}
	},
}

Functions

This section is empty.

Types

type PrettyHandler

type PrettyHandler struct {
	slog.Handler
	// contains filtered or unexported fields
}

func NewPrettyHandler

func NewPrettyHandler(
	out io.Writer,
	opts PrettyHandlerOptions,
) *PrettyHandler

func (*PrettyHandler) Handle

func (h *PrettyHandler) Handle(ctx context.Context, r slog.Record) error

type PrettyHandlerOptions

type PrettyHandlerOptions struct {
	SlogOpts slog.HandlerOptions
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL