12345678910111213141516171819202122232425262728293031323334 |
- package pcmserver
- import (
- "dy-admin/internal/pcmserver/options"
- "dy-admin/pkg/app"
- "dy-admin/pkg/log"
- "fmt"
- )
- const commandDesc = `pcm(phone cabinet manager) system command description`
- // NewApp creates an App object with default parameters.
- func NewApp(basename string) *app.App {
- opts := options.NewOptions()
- application := app.NewApp("pcm server",
- basename,
- app.WithOptions(opts),
- app.WithDescription(commandDesc),
- app.WithDefaultValidArgs(),
- app.WithRunFunc(run(opts)),
- )
- return application
- }
- func run(opts *options.Options) app.RunFunc {
- return func(basename string) error {
- log.Init(opts.LogOptions)
- defer log.Flush()
- fmt.Println("run...")
- return nil
- }
- }
|