this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

improvement to compact-all command (#359)

authored by

Whyrusleeping and committed by
GitHub
9b35e98e 491d808b

+21 -2
+21 -2
cmd/gosky/bgs.go
··· 347 347 348 348 var bgsCompactAll = &cli.Command{ 349 349 Name: "compact-all", 350 + Flags: []cli.Flag{ 351 + &cli.BoolFlag{ 352 + Name: "dry", 353 + }, 354 + &cli.IntFlag{ 355 + Name: "limit", 356 + }, 357 + }, 350 358 Action: func(cctx *cli.Context) error { 351 - url := cctx.String("bgs") + "/admin/repo/compactAll" 359 + uu, err := url.Parse(cctx.String("bgs") + "/admin/repo/compactAll") 360 + if err != nil { 361 + return err 362 + } 363 + 364 + if cctx.Bool("dry") { 365 + uu.Query().Add("dry", "true") 366 + } 367 + 368 + if cctx.IsSet("limit") { 369 + uu.Query().Add("limit", fmt.Sprint(cctx.Int("limit"))) 370 + } 352 371 353 - req, err := http.NewRequest("POST", url, nil) 372 + req, err := http.NewRequest("POST", uu.String(), nil) 354 373 if err != nil { 355 374 return err 356 375 }