Go · 596 bytes Raw Blame History
1 // SPDX-License-Identifier: AGPL-3.0-or-later
2
3 package main
4
5 import (
6 "fmt"
7 "runtime"
8
9 "github.com/spf13/cobra"
10
11 "github.com/tenseleyFlow/shithub/internal/version"
12 )
13
14 var versionCmd = &cobra.Command{
15 Use: "version",
16 Short: "Print version, commit, build time, and Go runtime",
17 Run: func(_ *cobra.Command, _ []string) {
18 fmt.Printf("shithubd-runner %s\n", version.Version)
19 fmt.Printf(" commit: %s\n", version.Commit)
20 fmt.Printf(" built: %s\n", version.BuiltAt)
21 fmt.Printf(" go: %s\n", runtime.Version())
22 fmt.Printf(" os: %s/%s\n", runtime.GOOS, runtime.GOARCH)
23 },
24 }
25