9-03 2 views
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
import ( "MySQLExport/build" "github.com/urfave/cli/v2" "log" "os" ) var AppFlags = []cli.Flag{ &cli.StringFlag{ Name: "config", Aliases: []string{"c"}, Value: "./config.yaml", Usage: "配置文件", }, &cli.StringFlag{ Name: "type", Aliases: []string{"t"}, Value: "csv", Usage: "输出文件类型,取值范围:csv | excel", }, } func Start() { app := &cli.App{ Name: "MySQLExport", Version: build.Version(), Description: "MySQL数据导出工具,如需支持请联系Eric(eng.eric.winn@gmail.com)", Flags: AppFlags, Action: func(c *cli.Context) error { return Factory(c) }, } err := app.Run(os.Args) if err != nil { log.Fatal(err) } } |
执行效果
如果想赏钱,可以用微信扫描下面的二维码,一来能刺激我写博客的欲望,二来好维护云主机的费用; 另外再次标注博客原地址 itnotebooks.com 感谢!
