Skip to content

Commit f916d61

Browse files
committed
add --additional-urls flag
1 parent 4454422 commit f916d61

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Diff for: cli/cli.go

+1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ func createCliCommandTree(cmd *cobra.Command) {
7878
cmd.PersistentFlags().BoolVar(&globals.Debug, "debug", false, "Enables debug output (super verbose, used to debug the CLI).")
7979
cmd.PersistentFlags().StringVar(&outputFormat, "format", "text", "The output format, can be [text|json].")
8080
cmd.PersistentFlags().StringVar(&globals.YAMLConfigFile, "config-file", "", "The custom config file (if not specified the default will be used).")
81+
cmd.PersistentFlags().StringSliceVar(&globals.AdditionalUrls, "additional-urls", []string{}, "Additional URLs for the board manager.")
8182
}
8283

8384
func preRun(cmd *cobra.Command, args []string) {

Diff for: cli/globals/globals.go

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ var (
3939
Config *configs.Configuration
4040
// YAMLConfigFile contains the path to the config file
4141
YAMLConfigFile string
42+
// AdditionalUrls contains the list of additional urls the boards manager can use
43+
AdditionalUrls []string
4244
)
4345

4446
func getHTTPClientHeader() http.Header {

Diff for: cli/instance/instance.go

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ func initInstance() *rpc.InitResp {
6262

6363
func packageManagerInitReq() *rpc.InitReq {
6464
urls := []string{}
65+
66+
for _, urlString := range globals.AdditionalUrls {
67+
urls = append(urls, urlString)
68+
}
69+
6570
for _, URL := range globals.Config.BoardManagerAdditionalUrls {
6671
urls = append(urls, URL.String())
6772
}

0 commit comments

Comments
 (0)