faasd/cmd/version.go
Alex Ellis (OpenFaaS Ltd) 17a5e2c625 Extract file for version command
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
2019-12-31 12:18:27 +00:00

31 lines
477 B
Go

package cmd
import (
"fmt"
"github.com/alexellis/faasd/pkg"
"github.com/morikuni/aec"
"github.com/spf13/cobra"
)
var versionCmd = &cobra.Command{
Use: "version",
Short: "Display version information.",
Run: parseBaseCommand,
}
func parseBaseCommand(_ *cobra.Command, _ []string) {
printLogo()
fmt.Printf(
`faasd
Commit: %s
Version: %s
`, pkg.GitCommit, pkg.GetVersion())
}
func printLogo() {
logoText := aec.WhiteF.Apply(pkg.Logo)
fmt.Println(logoText)
}