github.com/attic-labs/noms@v0.0.0-20210827224422-e5fa29d95e8b/cmd/noms/noms_version.go (about)

     1  // Copyright 2016 Attic Labs, Inc. All rights reserved.
     2  // Licensed under the Apache License, version 2.0:
     3  // http://www.apache.org/licenses/LICENSE-2.0
     4  
     5  package main
     6  
     7  import (
     8  	"fmt"
     9  	"os"
    10  
    11  	"github.com/attic-labs/kingpin"
    12  	"github.com/attic-labs/noms/cmd/util"
    13  	"github.com/attic-labs/noms/go/constants"
    14  )
    15  
    16  func nomsVersion(noms *kingpin.Application) (*kingpin.CmdClause, util.KingpinHandler) {
    17  	cmd := noms.Command("version", "Displays the Noms version understood by this command.")
    18  
    19  	return cmd, func(_ string) int {
    20  		fmt.Fprintf(os.Stdout, "format version: %v\n", constants.NomsVersion)
    21  		fmt.Fprintf(os.Stdout, "built from %v\n", constants.NomsGitSHA)
    22  		return 0
    23  	}
    24  }