cmd.go 618 B

1234567891011121314151617181920212223242526272829303132333435
  1. package daemon
  2. import (
  3. "fmt"
  4. "git.beejay.kim/tool/service/config"
  5. "github.com/urfave/cli/v2"
  6. )
  7. var (
  8. CMD = cli.Command{
  9. Name: "daemon",
  10. Usage: "run daemon",
  11. Action: func(ctx *cli.Context) error {
  12. var (
  13. cfg = config.Get[Configuration](ctx)
  14. )
  15. if cfg == nil {
  16. return fmt.Errorf("could not load Configuration")
  17. }
  18. return fmt.Errorf("implement me")
  19. },
  20. Flags: []cli.Flag{
  21. &cli.PathFlag{
  22. Name: "config",
  23. Usage: "config file path",
  24. Required: true,
  25. Aliases: []string{"C"},
  26. TakesFile: false,
  27. Action: config.Load[Configuration],
  28. },
  29. },
  30. }
  31. )