github.com/hhrutter/nomad@v0.6.0-rc2.0.20170723054333-80c4b03f0705/command/version.go (about)

     1  package command
     2  
     3  import (
     4  	"github.com/mitchellh/cli"
     5  )
     6  
     7  // VersionCommand is a Command implementation prints the version.
     8  type VersionCommand struct {
     9  	Version string
    10  	Ui      cli.Ui
    11  }
    12  
    13  func (c *VersionCommand) Help() string {
    14  	return ""
    15  }
    16  
    17  func (c *VersionCommand) Run(_ []string) int {
    18  	c.Ui.Output(c.Version)
    19  	return 0
    20  }
    21  
    22  func (c *VersionCommand) Synopsis() string {
    23  	return "Prints the Nomad version"
    24  }