Files
pmg/cmd/version/version.go
T

26 lines
554 B
Go
Raw Normal View History

2025-05-16 09:41:48 +05:30
package version
import (
"fmt"
"os"
2025-08-21 23:01:30 +05:30
"github.com/safedep/pmg/internal/ui"
"github.com/safedep/pmg/internal/version"
2025-05-16 09:41:48 +05:30
"github.com/spf13/cobra"
)
func NewVersionCommand() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Show version and build information",
RunE: func(cmd *cobra.Command, args []string) error {
2025-08-21 23:01:30 +05:30
fmt.Print(ui.GeneratePMGBanner(version.Version, version.Commit))
fmt.Fprintf(os.Stdout, "Version: %s\n", version.Version)
fmt.Fprintf(os.Stdout, "CommitSHA: %s\n", version.Commit)
2025-05-16 09:41:48 +05:30
return nil
},
}
}