| 2482 | ****************************************************************************/ |
| 2483 | |
| 2484 | int main(int argc, char **argv, char **envp) |
| 2485 | { |
| 2486 | char *outfile; |
| 2487 | const char *paranum; |
| 2488 | time_t now; |
| 2489 | struct tm *ptm; |
| 2490 | int ch; |
| 2491 | |
| 2492 | /* Parse command line options */ |
| 2493 | |
| 2494 | g_debug = false; |
| 2495 | g_kconfigroot = "."; |
| 2496 | g_appsdir = "../apps"; |
| 2497 | g_outfile = stdout; |
| 2498 | outfile = NULL; |
| 2499 | |
| 2500 | while ((ch = getopt(argc, argv, ":dhia:o:")) > 0) |
| 2501 | { |
| 2502 | switch (ch) |
| 2503 | { |
| 2504 | case 'a' : |
| 2505 | g_appsdir = optarg; |
| 2506 | break; |
| 2507 | |
| 2508 | case 'o' : |
| 2509 | outfile = optarg; |
| 2510 | break; |
| 2511 | |
| 2512 | case 'h' : |
| 2513 | show_usage(argv[0], 0); |
| 2514 | |
| 2515 | case 'd' : |
| 2516 | g_debug = true; |
| 2517 | break; |
| 2518 | |
| 2519 | case '?' : |
| 2520 | error("Unrecognized option: %c\n", optopt); |
| 2521 | show_usage(argv[0], ERROR_UNRECOGNIZED_OPTION); |
| 2522 | |
| 2523 | case ':' : |
| 2524 | error("Missing option argument, option: %c\n", optopt); |
| 2525 | show_usage(argv[0], ERROR_MISSING_OPTION_ARGUMENT); |
| 2526 | |
| 2527 | default: |
| 2528 | error("Unexpected option: %c\n", ch); |
| 2529 | show_usage(argv[0], ERROR_UNEXPECTED_OPTION); |
| 2530 | } |
| 2531 | } |
| 2532 | |
| 2533 | if (optind < argc) |
| 2534 | { |
| 2535 | g_kconfigroot = argv[optind]; |
| 2536 | optind++; |
| 2537 | } |
| 2538 | |
| 2539 | debug("Using <Kconfig directory>: %s\n", g_kconfigroot); |
| 2540 | debug("Using <apps directory>: %s\n", g_appsdir); |
| 2541 | debug("Using <out file>: %s\n", outfile ? outfile : "stdout"); |
nothing calls this directly
no test coverage detected