package main import ( "fmt" "gogs.tyduyong.com/duyong/dy-pkg/app" "gogs.tyduyong.com/duyong/dy-pkg/app/flagsets" ) const commandDesc = `pcm(phone cabinet manager) system command description` func main() { newApp("pcm").Run() } type Options struct { } func (o *Options) Flags() (fss flagsets.NamedFlagSets) { return fss } func (o *Options) Validate() []error { var errs []error return errs } func newApp(basename string) *app.App { opts := new(Options) application := app.NewApp("pcm server", basename, app.WithOptions(opts), app.WithNoConfig(), app.WithDescription(commandDesc), app.WithDefaultValidArgs(), app.WithRunFunc(run(opts)), ) return application } func run(opts *Options) app.RunFunc { return func(basename string) error { fmt.Println(123) return nil } }