github.com/manicqin/nomad@v0.9.5/command/version.go (about)

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