Files
releases/cmd/version.go
T
Patrick East b48c534722 Run make fmt with new goimports cmd
Signed-off-by: Patrick East <east.patrick@gmail.com>
2019-09-27 09:55:11 -04:00

31 lines
734 B
Go

// Copyright 2016 The OPA Authors. All rights reserved.
// Use of this source code is governed by an Apache2
// license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/open-policy-agent/opa/version"
)
func init() {
var versionCommand = &cobra.Command{
Use: "version",
Short: "Print the version of OPA",
Long: "Show version and build information for OPA.",
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("Version: " + version.Version)
fmt.Println("Build Commit: " + version.Vcs)
fmt.Println("Build Timestamp: " + version.Timestamp)
fmt.Println("Build Hostname: " + version.Hostname)
},
}
RootCommand.AddCommand(versionCommand)
}