优化缓存机制 补充错误码
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
package cmd
|
||||
|
||||
import (
|
||||
"complie-erlang/worker"
|
||||
"fmt"
|
||||
"github.com/spf13/cobra"
|
||||
"log"
|
||||
)
|
||||
|
||||
type modSet struct{}
|
||||
|
||||
func (m *modSet) run(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
_ = cmd.Help()
|
||||
return
|
||||
}
|
||||
modName := args[0]
|
||||
modArgs := args[1:]
|
||||
|
||||
if err := worker.ModWorkerRun(modName, modArgs); err != nil {
|
||||
log.Printf("[error] mod worker run error: %v", err)
|
||||
}
|
||||
|
||||
fmt.Printf("ok \n")
|
||||
}
|
||||
|
||||
func init() {
|
||||
var singleSet = new(modSet)
|
||||
var singleCmd = &cobra.Command{
|
||||
Use: "mod",
|
||||
Short: "根据约定模板生成 多个文件构建 功能模版",
|
||||
Long: `
|
||||
- 根据约定模板生成
|
||||
|
||||
mod activity activity_test.proto
|
||||
mod func test1.proto
|
||||
|
||||
`,
|
||||
Run: singleSet.run,
|
||||
}
|
||||
|
||||
rootCmd.AddCommand(singleCmd)
|
||||
}
|
||||
Reference in New Issue
Block a user