MCPcopy Create free account
hub / github.com/coreboot/coreboot / process_help

Function process_help

util/smmstoretool/main.c:354–383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352}
353
354static int process_help(int argc, char *argv[], const char store_file[])
355{
356 (void)store_file;
357
358 if (argc == 1) {
359 print_help();
360 return EXIT_SUCCESS;
361 }
362
363 if (argc != 2) {
364 fprintf(stderr, "Invalid invocation\n");
365 print_sub_command_usage(argv[0]);
366 return EXIT_FAILURE;
367 }
368
369 const char *sub_command = argv[1];
370
371 for (int i = 0; i < sub_command_count; ++i) {
372 const struct subcommand_t *cmd = &sub_commands[i];
373 if (!str_eq(cmd->name, sub_command))
374 continue;
375
376 cmd->print_help(stdout, cmd);
377 return EXIT_SUCCESS;
378 }
379
380 fprintf(stderr, "Unknown sub-command: %s\n", sub_command);
381 print_help();
382 return EXIT_FAILURE;
383}
384
385static void help_remove(FILE *f, const struct subcommand_t *info)
386{

Callers

nothing calls this directly

Calls 4

fprintfFunction · 0.85
print_sub_command_usageFunction · 0.85
str_eqFunction · 0.85
print_helpFunction · 0.70

Tested by

no test coverage detected