12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- package main
- import (
- "dy-pkg/app"
- "dy-pkg/app/flagsets"
- "fmt"
- )
- 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
- }
- }
|