2015-03-04 07:03:24 +00:00
|
|
|
package command
|
|
|
|
|
|
|
|
import (
|
2015-11-09 18:52:55 +00:00
|
|
|
"github.com/hashicorp/vault/version"
|
2015-03-04 07:03:24 +00:00
|
|
|
"github.com/mitchellh/cli"
|
|
|
|
)
|
|
|
|
|
|
|
|
// VersionCommand is a Command implementation prints the version.
|
|
|
|
type VersionCommand struct {
|
2015-11-09 18:52:55 +00:00
|
|
|
VersionInfo *version.VersionInfo
|
|
|
|
Ui cli.Ui
|
2015-03-04 07:03:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
func (c *VersionCommand) Help() string {
|
|
|
|
return ""
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *VersionCommand) Run(_ []string) int {
|
2016-09-01 18:54:04 +00:00
|
|
|
c.Ui.Output(c.VersionInfo.FullVersionNumber())
|
2015-03-04 07:03:24 +00:00
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
func (c *VersionCommand) Synopsis() string {
|
|
|
|
return "Prints the Vault version"
|
|
|
|
}
|