前置更新
前置更新
This commit is contained in:
@@ -14,6 +14,8 @@ import (
|
||||
)
|
||||
|
||||
var mysqlInfo config.MysqlDbInfo
|
||||
var outDir string
|
||||
var singular_table bool
|
||||
|
||||
var rootCmd = &cobra.Command{
|
||||
Use: "main",
|
||||
@@ -47,6 +49,12 @@ func init() {
|
||||
rootCmd.PersistentFlags().StringVarP(&mysqlInfo.Database, "database", "d", "", "数据库名")
|
||||
rootCmd.MarkFlagRequired("database")
|
||||
|
||||
rootCmd.PersistentFlags().StringVarP(&outDir, "outdir", "o", "", "输出目录")
|
||||
rootCmd.MarkFlagRequired("outdir")
|
||||
|
||||
rootCmd.PersistentFlags().StringVarP(&singular_table, "singular", "s", "", "是否禁用表名复数")
|
||||
rootCmd.MarkFlagRequired("singular")
|
||||
|
||||
rootCmd.Flags().IntVar(&mysqlInfo.Port, "port", 3306, "端口号")
|
||||
}
|
||||
|
||||
@@ -85,4 +93,8 @@ func MergeMysqlDbInfo() {
|
||||
}
|
||||
|
||||
config.SetMysqlDbInfo(&tmp)
|
||||
|
||||
config.SetOutDir(outDir)
|
||||
config.SetSingularTable(singular_table)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user