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

Function try_exec_man

cli/lightning-cli.c:301–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

mainFunction · 0.85

Calls 1

errFunction · 0.85

Tested by

no test coverage detected