Closed suntong closed 8 years ago
Hi 仕晋,
Please enable your CLI's Wiki.
I've got the following code automatically generated:
// -*- go -*- package main import ( "github.com/mkideal/cli" ) var _ = app.Register(&cli.Command{ Name: "build", Desc: "Build golang application", Text: "Usage:\n gogo build [Options] Arch(i386|amd64)", Argv: func() interface{} { return new(buildT) }, Fn: build, NumArg: cli.ExactN(1), CanSubRoute: true, }) type buildT struct { cli.Helper Dir string `cli:"dir" usage:"source code root dir" dft:"./"` Suffix string `cli:"suffix" usage:"source file suffix" dft:".go,.c,.s"` Out string `cli:"o,out" usage:"output filename"` } func build(ctx *cli.Context) error { argv := ctx.Argv().(*buildT) ctx.String("%s: %v", ctx.Path(), jsonIndent(argv)) ctx.String("[build]: %v\n", ctx.Args()) return nil } package main import ( "github.com/mkideal/cli" ) var _ = app.Register(&cli.Command{ Name: "install", Desc: "Install golang application", Text: "Usage:\n gogo install [Options] package [package...]", Argv: func() interface{} { return new(installT) }, Fn: install, NumArg: cli.AtLeast(1), CanSubRoute: true, }) type installT struct { cli.Helper Dir string `cli:"dir" usage:"source code root dir" dft:"./"` Suffix string `cli:"suffix" usage:"source file suffix" dft:".go,.c,.s"` Out string `cli:"o,out" usage:"output filename"` } func install(ctx *cli.Context) error { argv := ctx.Argv().(*installT) ctx.String("%s: %v", ctx.Path(), jsonIndent(argv)) ctx.String("[install]: %v\n", ctx.Args()) return nil }
I can explain how in your enabled CLI's Wiki.
wiki enabled.
K. will do later...
Can't edit it.
I've edited other wiki before, so I know it is must be a permission issue.
I'm sorry! Try again now.
Yep. Thx.
Hi 仕晋,
Please enable your CLI's Wiki.
I've got the following code automatically generated:
I can explain how in your enabled CLI's Wiki.