-
Notifications
You must be signed in to change notification settings - Fork 127
/
root.go
28 lines (23 loc) · 919 Bytes
/
root.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cmd
import (
"github.com/spf13/cobra"
)
// RootCmd is the root Cobra command that gets called from the main func.
// All other sub-commands should be registered here.
func RootCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "pulsartest",
Short: "pulsartest provides tools for generating and observing Pulsar events.",
}
cmd.PersistentFlags().String("url", "pulsar://localhost:6650", "URL to connect to Pulsar on.")
cmd.PersistentFlags().Bool("authenticationEnabled", false, "Use authentication.")
cmd.PersistentFlags().String("authenticationType", "JWT", "Authentication type")
cmd.PersistentFlags().String("jwtTokenPath", "", "Path of JWT file")
cmd.PersistentFlags().String("jobsetEventsTopic", "events", "Pulsar topic for this jobset")
cmd.PersistentFlags().String("compressionType", "none", "Type of compression to use")
cmd.AddCommand(
submitCmd(),
watchCmd(),
)
return cmd
}