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)
}