MCPcopy Create free account
hub / github.com/ElementsProject/lightning / try_exec_man

Function try_exec_man

cli/lightning-cli.c:293–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293static void
294try_exec_man (const char *page, char *relative_to) {
295 int status;
296
297 switch (fork()) {
298 case -1:
299 err(1, "Forking man command");
300 case 0:
301 /* child, run man command. */
302 if (relative_to != NULL) {
303 page = tal_fmt(page, "%s/%s.7", relative_to, page);
304 execlp("man", "man", "-l", page, (char *)NULL);
305 }
306 else {
307 execlp("man", "man", page, (char *)NULL);
308 }
309
310 err(1, "Running man command");
311 default:
312 break;
313 }
314
315 wait(&status);
316 if (WIFEXITED(status) && WEXITSTATUS(status) == 0)
317 exit(0);
318}
319
320static void print_json(const char *str, const jsmntok_t *tok, const char *indent)
321{

Callers 1

mainFunction · 0.85

Calls 1

errFunction · 0.85

Tested by

no test coverage detected