Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • v1.1.0
7 results

08_version.go

Blame
  • 08_version.go 700 B
    package commands
    
    import (
    	"github.com/jessevdk/go-flags"
    	"gitlab.schukai.com/oss/utilities/documentation-manager/translations"
    )
    
    const versionSymbol = "version"
    
    func init() {
    
    	h := handler{
    		init:    initVersion,
    		execute: runVersion,
    	}
    
    	handlers.executor[versionSymbol] = h
    
    }
    
    type VersionDefinition struct {
    }
    
    func initVersion(command *flags.Command) {
    	const text = "Prints the version and build information"
    	command.ShortDescription = translations.T.Sprintf(text)
    	command.LongDescription = translations.T.Sprintf(text)
    }
    
    func runVersion(command *flags.Command) {
    	translations.T.Printf("version: %s\n", state.info.Version)
    	translations.T.Printf("build: %s\n", state.info.Build)
    }