mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
e2297a7833
- Updated source code layout to use standard Go project structure. - Makefile for build and test execution. - Glide for dependency management. - Integrated spf13/cobra for command line entry point. - Added docs on release and development process.
26 lines
727 B
Go
26 lines
727 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"
|
|
import "github.com/spf13/cobra"
|
|
import "github.com/open-policy-agent/opa/version"
|
|
|
|
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)
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
RootCommand.AddCommand(versionCommand)
|
|
}
|