2016-06-03 09:09:14 +08:00
|
|
|
package command
|
2012-08-07 07:54:53 +08:00
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"runtime"
|
2014-10-27 02:34:55 +08:00
|
|
|
|
2016-06-03 09:09:14 +08:00
|
|
|
"github.com/chrislusf/seaweedfs/weed/util"
|
2012-08-07 07:54:53 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
var cmdVersion = &Command{
|
|
|
|
Run: runVersion,
|
|
|
|
UsageLine: "version",
|
2015-04-17 05:11:25 +08:00
|
|
|
Short: "print SeaweedFS version",
|
|
|
|
Long: `Version prints the SeaweedFS version`,
|
2012-08-07 07:54:53 +08:00
|
|
|
}
|
|
|
|
|
2012-09-24 17:01:53 +08:00
|
|
|
func runVersion(cmd *Command, args []string) bool {
|
2012-08-07 07:54:53 +08:00
|
|
|
if len(args) != 0 {
|
|
|
|
cmd.Usage()
|
|
|
|
}
|
|
|
|
|
2020-06-02 15:10:35 +08:00
|
|
|
fmt.Printf("version %s %s %s\n", util.Version(), runtime.GOOS, runtime.GOARCH)
|
2012-08-07 09:20:26 +08:00
|
|
|
return true
|
2012-08-07 07:54:53 +08:00
|
|
|
}
|