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

Function learnMain

commands.go:282–309  ·  view source on GitHub ↗
(helpCommand []string)

Source from the content-addressed store, hash-verified

280}
281
282func learnMain(helpCommand []string) {
283 config, err := server.DefaultConfiguration()
284 verifyFatal(err)
285
286 dir, err := os.Getwd()
287 verifyFatal(err)
288
289 command := datastore.Command{
290 Args: helpCommand,
291 Env: os.Environ(),
292 Dir: dir,
293 }
294
295 req := server.AddHelpPageRequest{
296 Command: command,
297 }
298
299 client, err := server.NewClient(config)
300 if err != nil {
301 fatal(fmt.Errorf("cannot connect to daemon: %w", err))
302 }
303
304 var rsp server.AddHelpPageResponse
305 err = client.Request(&req, &rsp)
306 verifyFatal(err)
307 err = summarizeLearning(&rsp)
308 verifyFatal(err)
309}
310
311type byApplication []server.ListCommandsResponseItem
312

Callers 1

mainFunction · 0.85

Calls 6

RequestMethod · 0.95
DefaultConfigurationFunction · 0.92
NewClientFunction · 0.92
verifyFatalFunction · 0.85
summarizeLearningFunction · 0.85
fatalFunction · 0.70

Tested by

no test coverage detected