open-vault/command/version.go

26 lines
481 B
Go
Raw Normal View History

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 {
2015-11-09 18:52:55 +00:00
c.Ui.Output(c.VersionInfo.String())
2015-03-04 07:03:24 +00:00
return 0
}
func (c *VersionCommand) Synopsis() string {
return "Prints the Vault version"
}