Initial commit: Open sourcing all of the Maple Open Technologies code.

This commit is contained in:
Bartlomiej Mika 2025-12-02 14:33:08 -05:00
commit 755d54a99d
2010 changed files with 448675 additions and 0 deletions

View file

@ -0,0 +1,37 @@
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
// Build information set at compile time
var (
version = "1.0.0"
gitCommit = "unknown"
buildTime = "unknown"
)
// SetBuildInfo sets the build information from main package
func SetBuildInfo(v, commit, time string) {
version = v
gitCommit = commit
buildTime = time
}
// GetBuildInfo returns the current build information
func GetBuildInfo() (string, string, string) {
return version, gitCommit, buildTime
}
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print the version number",
Long: `Print the version number of MapleFile backend.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Printf("MapleFile Backend v%s\n", version)
fmt.Printf("Git Commit: %s\n", gitCommit)
fmt.Printf("Build Time: %s\n", buildTime)
},
}