Text to Speech Speech to Text

version.go 610B

123456789101112131415161718192021222324
  1. package version
  2. import (
  3. "fmt"
  4. "os"
  5. "github.com/spf13/cobra"
  6. )
  7. // Version command return api version for tracking binary in different server
  8. func RunCommand(apiVersion, gitCommit, built string) *cobra.Command {
  9. return &cobra.Command{
  10. Use: "version",
  11. Short: "The version of forum",
  12. Aliases: []string{"v"},
  13. Run: func(cmd *cobra.Command, args []string) {
  14. fmt.Fprintln(os.Stdout, "Server:")
  15. fmt.Fprintln(os.Stdout, " Api Version: ", apiVersion)
  16. fmt.Fprintln(os.Stdout, " Git commit: ", gitCommit)
  17. fmt.Fprintln(os.Stdout, " Built: ", built)
  18. },
  19. }
  20. }