MCPcopy Create free account
hub / github.com/OpenIPC/firmware / main

Function main

general/package/legacy/lshell/src/lshell.c:393–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393int main(int argc, char *argv[])
394{
395 FILE *input;
396
397 // Init the array of paths that
398 // the shell with look for executables in
399 init_paths();
400
401 if (argc > 1) // If arg is supplied use batch mode
402 {
403 input = fopen(argv[1], "r");
404 if (input == NULL || argc > 2) // If the input file doesn't exist or multiple input file arguments were given
405 {
406 print_err();
407 exit(1);
408 }
409
410 batch_mode(input);
411 }
412 else // else use interactive mode
413 {
414 interactive_mode();
415 }
416
417 free_paths();
418 exit(0);
419}

Callers

nothing calls this directly

Calls 5

init_pathsFunction · 0.85
print_errFunction · 0.85
batch_modeFunction · 0.85
interactive_modeFunction · 0.85
free_pathsFunction · 0.85

Tested by

no test coverage detected