53 lines
1.2 KiB
Go
53 lines
1.2 KiB
Go
package util
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"github.com/wild-cloud/wild-cli/internal/output"
|
|
)
|
|
|
|
const (
|
|
Version = "0.1.0-dev"
|
|
BuildDate = "development"
|
|
)
|
|
|
|
func NewVersionCommand() *cobra.Command {
|
|
return &cobra.Command{
|
|
Use: "version",
|
|
Short: "Show version information",
|
|
Long: `Show version information for Wild CLI and components.
|
|
|
|
This command displays version information for the Wild CLI and related components.
|
|
|
|
Examples:
|
|
wild version`,
|
|
RunE: runVersion,
|
|
}
|
|
}
|
|
|
|
func runVersion(cmd *cobra.Command, args []string) error {
|
|
output.Header("Wild CLI Version Information")
|
|
|
|
output.Info(fmt.Sprintf("Wild CLI Version: %s", Version))
|
|
output.Info(fmt.Sprintf("Build Date: %s", BuildDate))
|
|
output.Info(fmt.Sprintf("Go Version: %s", "go1.21+"))
|
|
|
|
// TODO: Add component versions
|
|
// - kubectl version
|
|
// - talosctl version
|
|
// - restic version
|
|
// - yq version
|
|
|
|
output.Info("")
|
|
output.Info("Components:")
|
|
output.Info(" - Native Go implementation replacing 35+ bash scripts")
|
|
output.Info(" - Unified CLI with Cobra framework")
|
|
output.Info(" - Cross-platform support (Linux/macOS/Windows)")
|
|
output.Info(" - Built-in template engine with sprig functions")
|
|
output.Info(" - Integrated external tool management")
|
|
|
|
return nil
|
|
}
|