cmd.go 452 B

12345678910111213141516171819202122232425
  1. package quickstart
  2. import "github.com/spf13/cobra"
  3. const (
  4. serviceTypeMono = "mono"
  5. serviceTypeMicro = "micro"
  6. )
  7. var (
  8. varStringServiceType string
  9. // Cmd describes the command to run.
  10. Cmd = &cobra.Command{
  11. Use: "quickstart",
  12. Short: "quickly start a project",
  13. RunE: run,
  14. }
  15. )
  16. func init() {
  17. Cmd.Flags().StringVarP(&varStringServiceType,
  18. "service-type", "t", "mono",
  19. "specify the service type, supported values: [mono, micro]")
  20. }