@@ -367,6 +367,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
367367 // only change if we have the client and type differs
368368 if cl , ok := c .opts .Clients [name ]; ok && (* c .opts .Client ).String () != name {
369369 * c .opts .Client = cl ()
370+ client .DefaultClient = * c .opts .Client
370371 }
371372 }
372373
@@ -375,6 +376,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
375376 // only change if we have the server and type differs
376377 if s , ok := c .opts .Servers [name ]; ok && (* c .opts .Server ).String () != name {
377378 * c .opts .Server = s ()
379+ server .DefaultServer = * c .opts .Server
378380 }
379381 }
380382
@@ -386,6 +388,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
386388 }
387389
388390 * c .opts .Store = s (store .WithClient (* c .opts .Client ))
391+ store .DefaultStore = * c .opts .Store
389392 }
390393
391394 // Set the tracer
@@ -396,6 +399,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
396399 }
397400
398401 * c .opts .Tracer = r ()
402+ trace .DefaultTracer = * c .opts .Tracer
399403 }
400404
401405 // Setup auth
@@ -422,6 +426,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
422426 }
423427
424428 * c .opts .Auth = r (authOpts ... )
429+ auth .DefaultAuth = * c .opts .Auth
425430 }
426431
427432 // Set the registry
@@ -444,6 +449,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
444449 if err := (* c .opts .Broker ).Init (broker .Registry (* c .opts .Registry )); err != nil {
445450 logger .Fatalf ("Error configuring broker: %v" , err )
446451 }
452+ registry .DefaultRegistry = * c .opts .Registry
447453 }
448454
449455 // Set the profile
@@ -454,6 +460,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
454460 }
455461
456462 * c .opts .Profile = p ()
463+ profile .DefaultProfile = * c .opts .Profile
457464 }
458465
459466 // Set the broker
@@ -466,6 +473,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
466473 * c .opts .Broker = b ()
467474 serverOpts = append (serverOpts , server .Broker (* c .opts .Broker ))
468475 clientOpts = append (clientOpts , client .Broker (* c .opts .Broker ))
476+ broker .DefaultBroker = * c .opts .Broker
469477 }
470478
471479 // Set the selector
@@ -479,6 +487,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
479487
480488 // No server option here. Should there be?
481489 clientOpts = append (clientOpts , client .Selector (* c .opts .Selector ))
490+ selector .DefaultSelector = * c .opts .Selector
482491 }
483492
484493 // Set the transport
@@ -491,6 +500,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
491500 * c .opts .Transport = t ()
492501 serverOpts = append (serverOpts , server .Transport (* c .opts .Transport ))
493502 clientOpts = append (clientOpts , client .Transport (* c .opts .Transport ))
503+ transport .DefaultTransport = * c .opts .Transport
494504 }
495505
496506 // Parse the server options
@@ -630,6 +640,7 @@ func (c *cmd) Before(ctx *cli.Context) error {
630640 logger .Fatalf ("Error configuring config: %v" , err )
631641 }
632642 * c .opts .Config = rc
643+ config .DefaultConfig = * c .opts .Config
633644 }
634645 }
635646
0 commit comments