|
|
|
@ -13,12 +13,15 @@ import ( |
|
|
|
"github.com/yedf/dtm/examples" |
|
|
|
) |
|
|
|
|
|
|
|
var Version, Commit, Date string |
|
|
|
|
|
|
|
var usage = `dtm is a lightweight distributed transaction manager. |
|
|
|
|
|
|
|
usage: |
|
|
|
dtm [command] |
|
|
|
|
|
|
|
Available commands: |
|
|
|
version print dtm version |
|
|
|
dtmsvr run dtm as a server |
|
|
|
dev create all needed table and run dtm as a server |
|
|
|
bench start bench server |
|
|
|
@ -35,6 +38,10 @@ func main() { |
|
|
|
} |
|
|
|
return |
|
|
|
} |
|
|
|
if os.Args[1] == "version" { |
|
|
|
fmt.Printf("version: %s commit: %s built at: %s\n", Version, Commit, Date) |
|
|
|
return |
|
|
|
} |
|
|
|
dtmcli.SetCurrentDBType(common.DtmConfig.DB["driver"]) |
|
|
|
if os.Args[1] != "dtmsvr" { // 实际线上运行,只启动dtmsvr,不准备table相关的数据
|
|
|
|
common.WaitDBUp() |
|
|
|
|