37 lines
650 B
Go
37 lines
650 B
Go
|
package main
|
||
|
|
||
|
import (
|
||
|
"github.com/spf13/cobra"
|
||
|
"github.com/wormhole-foundation/wormhole-explorer/fly-event-processor/cmd/service"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
execute()
|
||
|
}
|
||
|
|
||
|
func execute() error {
|
||
|
root := &cobra.Command{
|
||
|
Use: "fly-event-processor",
|
||
|
Run: func(cmd *cobra.Command, args []string) {
|
||
|
if len(args) == 0 {
|
||
|
service.Run()
|
||
|
}
|
||
|
},
|
||
|
}
|
||
|
|
||
|
addServiceCommand(root)
|
||
|
|
||
|
return root.Execute()
|
||
|
}
|
||
|
|
||
|
func addServiceCommand(root *cobra.Command) {
|
||
|
serviceCommand := &cobra.Command{
|
||
|
Use: "service",
|
||
|
Short: "Run fly-event-processor as service",
|
||
|
Run: func(_ *cobra.Command, _ []string) {
|
||
|
service.Run()
|
||
|
},
|
||
|
}
|
||
|
root.AddCommand(serviceCommand)
|
||
|
}
|