github.com/chasestarr/deis@v1.13.5-0.20170519182049-1d9e59fbdbfc/client/parser/version.go (about)

     1  package parser
     2  
     3  import (
     4  	"fmt"
     5  
     6  	"github.com/deis/deis/version"
     7  	docopt "github.com/docopt/docopt-go"
     8  )
     9  
    10  // Version displays the client version
    11  func Version(argv []string) error {
    12  	usage := `
    13  Displays the client version.
    14  
    15  Usage: deis version
    16  
    17  Use 'deis help [command]' to learn more.
    18  `
    19  	if _, err := docopt.Parse(usage, argv, true, "", false, true); err != nil {
    20  		return err
    21  	}
    22  
    23  	fmt.Println(version.Version)
    24  	return nil
    25  }