diff --git a/command/version.go b/command/version.go index 4e433435f..999af7abf 100644 --- a/command/version.go +++ b/command/version.go @@ -3,24 +3,26 @@ package command import ( "bytes" "fmt" - - "github.com/mitchellh/cli" ) // VersionCommand is a Command implementation prints the version. type VersionCommand struct { + Meta + Revision string Version string VersionPrerelease string - Ui cli.Ui } func (c *VersionCommand) Help() string { return "" } -func (c *VersionCommand) Run(_ []string) int { +func (c *VersionCommand) Run(args []string) int { var versionString bytes.Buffer + + args = c.Meta.process(args) + fmt.Fprintf(&versionString, "Terraform v%s", c.Version) if c.VersionPrerelease != "" { fmt.Fprintf(&versionString, ".%s", c.VersionPrerelease) diff --git a/commands.go b/commands.go index e7e4d052d..870ca39d1 100644 --- a/commands.go +++ b/commands.go @@ -71,10 +71,10 @@ func init() { "version": func() (cli.Command, error) { return &command.VersionCommand{ + Meta: meta, Revision: GitCommit, Version: Version, VersionPrerelease: VersionPrerelease, - Ui: Ui, }, nil }, }