diff --git a/cmd/cmd.go b/cmd/cmd.go index 73aef330..865fd61d 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -55,7 +55,7 @@ var ( ran bool shutdownGrace = 10 * time.Second - federations = []string{} + federations = "" ) func ParseCLI() (err error) { @@ -198,7 +198,9 @@ func commonConfigure() error { // If list of federations is specified on the CLI, mutate the configuration directly if len(federations) > 0 { - cfg.Choria.FederationCollectives = federations + cfg.Choria.FederationCollectives = strings.Split(federations, ",") + } else { + fmt.Println("We are not setting federations") } applyBuildAndEnvironmentSettings() diff --git a/cmd/discover.go b/cmd/discover.go index e39497cc..c707b6cd 100644 --- a/cmd/discover.go +++ b/cmd/discover.go @@ -23,8 +23,6 @@ type discoverCommand struct { verbose bool silent bool fo *discovery.StandardOptions - - federations []string } func (d *discoverCommand) Setup() error { @@ -37,7 +35,9 @@ func (d *discoverCommand) Setup() error { d.fo.AddSelectionFlags(d.cmd) d.fo.AddFlatFileFlags(d.cmd) - d.cmd.Flag("federations", "List of federations to search for collectives in").StringsVar(&federations) + d.cmd.Flag("federations", "List of federations to search for collectives in, comma seperated").StringVar(&federations) + + fmt.Println("asdf") d.cmd.Flag("verbose", "Log verbosely").Default("false").Short('v').UnNegatableBoolVar(&d.verbose) d.cmd.Flag("json", "Produce JSON output").Short('j').UnNegatableBoolVar(&d.jsonFormat) @@ -48,6 +48,7 @@ func (d *discoverCommand) Setup() error { func (d *discoverCommand) Configure() error { err = commonConfigure() + if err != nil { return err }