MCPcopy Create free account
hub / github.com/dim-an/cod / listMain

Function listMain

commands.go:350–373  ·  view source on GitHub ↗
(selectors []string)

Source from the content-addressed store, hash-verified

348}
349
350func 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
375func removeMain(selectors []string) {
376 app := NewApplication()

Callers 1

mainFunction · 0.85

Calls 7

CloseMethod · 0.95
ClientMethod · 0.95
QuoteFunction · 0.92
NewApplicationFunction · 0.85
verifyFatalFunction · 0.85
byApplicationTypeAlias · 0.85
RequestMethod · 0.80

Tested by

no test coverage detected