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

Function launch_args_parse

dpdk/app/pdump/main.c:384–419  ·  view source on GitHub ↗

Parse the argument given in the command line of the application */

Source from the content-addressed store, hash-verified

382
383/* Parse the argument given in the command line of the application */
384static int
385launch_args_parse(int argc, char **argv, char *prgname)
386{
387 int opt, ret;
388 int option_index;
389 static struct option long_option[] = {
390 {CMD_LINE_OPT_PDUMP, 1, 0, CMD_LINE_OPT_PDUMP_NUM},
391 {CMD_LINE_OPT_MULTI, 0, 0, CMD_LINE_OPT_MULTI_NUM},
392 {NULL, 0, 0, 0}
393 };
394
395 if (argc == 1)
396 pdump_usage(prgname);
397
398 /* Parse command line */
399 while ((opt = getopt_long(argc, argv, " ",
400 long_option, &option_index)) != EOF) {
401 switch (opt) {
402 case CMD_LINE_OPT_PDUMP_NUM:
403 ret = parse_pdump(optarg);
404 if (ret) {
405 pdump_usage(prgname);
406 return -1;
407 }
408 break;
409 case CMD_LINE_OPT_MULTI_NUM:
410 multiple_core_capture = 1;
411 break;
412 default:
413 pdump_usage(prgname);
414 return -1;
415 }
416 }
417
418 return 0;
419}
420
421static void
422monitor_primary(void *arg __rte_unused)

Callers 1

mainFunction · 0.70

Calls 3

pdump_usageFunction · 0.85
getopt_longFunction · 0.85
parse_pdumpFunction · 0.85

Tested by

no test coverage detected