(selectors []string)
| 348 | } |
| 349 | |
| 350 | func listMain(selectors []string) { |
| 351 | app := NewApplication() |
| 352 | defer app.Close() |
| 353 | |
| 354 | req := server.ListCommandsRequest{} |
| 355 | if len(selectors) > 0 { |
| 356 | req.Selectors = selectors |
| 357 | } else { |
| 358 | req.Selectors = []string{"/**"} |
| 359 | } |
| 360 | rsp := server.ListCommandsResponse{} |
| 361 | err := app.Client().Request(&req, &rsp) |
| 362 | verifyFatal(err) |
| 363 | |
| 364 | sort.Sort(byApplication(rsp.CommandItems)) |
| 365 | for _, item := range rsp.CommandItems { |
| 366 | quoted := "<broken>" |
| 367 | if item.Command != nil { |
| 368 | quoted = shells.Quote(item.Command.Args) |
| 369 | } |
| 370 | |
| 371 | fmt.Printf("%v\t%v\n", item.Id, quoted) |
| 372 | } |
| 373 | } |
| 374 | |
| 375 | func removeMain(selectors []string) { |
| 376 | app := NewApplication() |
no test coverage detected