buildr/internal/cmd/version.go
Peter e60726ef9e
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
feat: implement new and man for plugin modules
- use extracted shared libraries
2023-08-23 22:06:26 +02:00

26 lines
486 B
Go

package cmd
import (
"log/slog"
"runtime"
"github.com/spf13/cobra"
)
var CurrentVersion = "development"
func VersionCommand() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Prints the version of the CLI",
SilenceUsage: true,
SilenceErrors: true,
Run: func(*cobra.Command, []string) {
slog.Info("BuildR version",
slog.String("current_version", CurrentVersion),
slog.String("go_version", runtime.Version()),
)
},
}
}