github.com/avenga/couper@v1.12.2/command/version.go (about)

     1  package command
     2  
     3  import (
     4  	"runtime"
     5  
     6  	"github.com/sirupsen/logrus"
     7  
     8  	"github.com/avenga/couper/config"
     9  	"github.com/avenga/couper/utils"
    10  )
    11  
    12  var _ Cmd = &Version{}
    13  
    14  type Version struct{}
    15  
    16  func NewVersion() *Version {
    17  	return &Version{}
    18  }
    19  
    20  func (v Version) Execute(_ Args, _ *config.Couper, _ *logrus.Entry) error {
    21  	println(utils.VersionName + " " + utils.BuildDate + " " + utils.BuildName)
    22  	println("go version " + runtime.Version() + " " + runtime.GOOS + "/" + runtime.GOARCH)
    23  	return nil
    24  }
    25  
    26  func (v Version) Usage() {
    27  	println("Usage of version:\n  version	Print current version and build information.")
    28  }