MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ReadCmd

Function ReadCmd

tools/ngctl/main.c:574–596  ·  view source on GitHub ↗

* ReadCmd() */

Source from the content-addressed store, hash-verified

572 * ReadCmd()
573 */
574static int
575ReadCmd(int ac, char **av)
576{
577 FILE *fp;
578 int rtn;
579
580 /* Open file */
581 switch (ac) {
582 case 2:
583 if ((fp = fopen(av[1], "r")) == NULL) {
584 warn("%s", av[1]);
585 return (CMDRTN_ERROR);
586 }
587 break;
588 default:
589 return (CMDRTN_USAGE);
590 }
591
592 /* Process it */
593 rtn = ReadFile(fp);
594 fclose(fp);
595 return (rtn);
596}
597
598/*
599 * HelpCmd()

Callers

nothing calls this directly

Calls 1

ReadFileFunction · 0.85

Tested by

no test coverage detected