From 15c4400c096b4a3082dd2c5c6e6f93d2d8a7d2df Mon Sep 17 00:00:00 2001 From: hitzhangjie Date: Fri, 24 Sep 2021 19:37:48 +0800 Subject: [PATCH] refactor: align the commands --- app/main.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/app/main.go b/app/main.go index d9c8885..9262b3d 100644 --- a/app/main.go +++ b/app/main.go @@ -10,27 +10,24 @@ import ( "github.com/yedf/dtm/examples" ) -// M alias -type M = map[string]interface{} - var usage = `dtm is a lightweight distributed transaction manager. usage: dtm [command] Available commands: - dtmsvr run dtm as a server - dev create all needed table and run dtm as a server + dtmsvr run dtm as a server + dev create all needed table and run dtm as a server - quick_start run quick start example (dtm will create needed table) - qs same as quick_start + quick_start run quick start example (dtm will create needed table) + qs same as quick_start ` func main() { if len(os.Args) == 1 { fmt.Println(usage) for name := range examples.Samples { - fmt.Printf("%-18srun a sample includes %s\n", name, strings.Replace(name, "_", " ", 100)) + fmt.Printf("%4s%-18srun a sample includes %s\n", "", name, strings.ReplaceAll(name, "_", " ")) } return }