ots/cmd/ots-cli/cmd_version.go
Knut Ahlers f2a7af30b2
[#159] Add version-command for ots-cli
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-12-13 16:28:20 +01:00

20 lines
309 B
Go

package main
import (
"fmt"
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Displays the tool version",
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("ots-cli %s\n", version) //nolint:forbidigo
},
}
func init() {
rootCmd.AddCommand(versionCmd)
}