version.go 446 B

123456789101112131415161718192021222324
  1. package command
  2. import (
  3. "fmt"
  4. "runtime"
  5. "github.com/chrislusf/seaweedfs/weed/util"
  6. )
  7. var cmdVersion = &Command{
  8. Run: runVersion,
  9. UsageLine: "version",
  10. Short: "print SeaweedFS version",
  11. Long: `Version prints the SeaweedFS version`,
  12. }
  13. func runVersion(cmd *Command, args []string) bool {
  14. if len(args) != 0 {
  15. cmd.Usage()
  16. }
  17. fmt.Printf("version %s %s %s\n", util.Version(), runtime.GOOS, runtime.GOARCH)
  18. return true
  19. }