Skip to content

Commit

Permalink
cleanup setUris()
Browse files Browse the repository at this point in the history
  • Loading branch information
mkuratczyk committed Aug 13, 2024
1 parent 948d03d commit d626f73
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ func RootCmd() *cobra.Command {
_, _ = fmt.Fprintf(os.Stderr, "ERROR: size can't be less than 12 bytes\n")
os.Exit(1)
}
setUris(&cfg, cmd.Use)
if cmd.Use != "version" {
setUris(&cfg, cmd.Use)
}

// nanoseconds shouldn't be used across processes
if cfg.Publishers == 0 || cfg.Consumers == 0 {
Expand Down Expand Up @@ -306,9 +308,6 @@ func start(cfg config.Config, publisherProto common.Protocol, consumerProto comm
}

func setUris(cfg *config.Config, command string) {
if command == "version" {
return
}
if cfg.PublisherUri == nil {
println("setting publisher uri to ", defaultUri(strings.Split(command, "-")[0]))
(*cfg).PublisherUri = []string{defaultUri(strings.Split(command, "-")[0])}
Expand Down

0 comments on commit d626f73

Please sign in to comment.