openbmc/build/tmp/deploy/sdk/witherspoon-2019-08-08/sysroots/armv6-openbmc-linux-gnueabi/usr/src/debug/nss-pam-ldapd/0.9.8-r0/nss-pam-ldapd-0.9.8/nslcd/nslcd.c
static void parse_cmdline(int argc, char* argv[])
{
    int optc;
    while ((optc = getopt_long(argc, argv, NSLCD_OPTIONSTRING, nslcd_options,
                               NULL)) != -1)
    {
        switch (optc)
        {
            case 'c': /* -c, --check        check if the daemon already is
                         running */
                nslcd_checkonly = 1;
                break;
            case 'd': /* -d, --debug        don't fork and print debugging to
                         stderr */
                nslcd_debugging++;
                log_setdefaultloglevel(LOG_DEBUG);
                break;
            case 'n': /* -n, --nofork       don't fork */
                nslcd_nofork++;
                break;
            case 'h': /*     --help         display this help and exit */
                display_usage(stdout, argv[0]);
                exit(EXIT_SUCCESS);
            case 'V': /*     --version      output version information and exit
                       */
                display_version(stdout);
                exit(EXIT_SUCCESS);
            case ':': /* missing required parameter */
            case '?': /* unknown option character or extraneous parameter */
            default:
                fprintf(stderr, "Try '%s --help' for more information.\n",
                        argv[0]);
                exit(EXIT_FAILURE);
        }
    }
    /* check for remaining arguments */
    if (optind < argc)
    {
        fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0],
                argv[optind]);
        fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]);
        exit(EXIT_FAILURE);
    }
}
/* parse command line options and save settings in struct  */
parse command line options and save settings in struct
parse command line options and save settings in struct
static void parse_cmdline(int argc, char* argv[])
{
    int optc;
    while ((optc = getopt_long(argc, argv, NSLCD_OPTIONSTRING, nslcd_options,
                               NULL)) != -1)
    {
        switch (optc)
        {
            case 'c': 
                nslcd_checkonly = 1;
                break;
            case 'd': 
                nslcd_debugging++;
                log_setdefaultloglevel(LOG_DEBUG);
                break;
            case 'n': 
                nslcd_nofork++;
                break;
            case 'h': 
                display_usage(stdout, argv[0]);
                exit(EXIT_SUCCESS);
            case 'V': 
                display_version(stdout);
                exit(EXIT_SUCCESS);
            case ':': 
            case '?': 
            default:
                fprintf(stderr, "Try '%s --help' for more information.\n",
                        argv[0]);
                exit(EXIT_FAILURE);
        }
    }
    if (optind < argc)
    {
        fprintf(stderr, "%s: unrecognized option '%s'\n", argv[0],
                argv[optind]);
        fprintf(stderr, "Try '%s --help' for more information.\n", argv[0]);
        exit(EXIT_FAILURE);
    }
}
static void parse_cmdline ( int argc , char * argv [ ] ) { int optc ; while ( ( optc = getopt_long ( argc , argv , NSLCD_OPTIONSTRING , nslcd_options , NULL ) ) != -1 ) { switch ( optc ) { case ' ' : nslcd_checkonly = 1 ; break ; case ' ' : nslcd_debugging ++ ; log_setdefaultloglevel ( LOG_DEBUG ) ; break ; case ' ' : nslcd_nofork ++ ; break ; case ' ' : display_usage ( stdout , argv [ 0 ] ) ; exit ( EXIT_SUCCESS ) ; case ' ' : display_version ( stdout ) ; exit ( EXIT_SUCCESS ) ; case ' ' : case ' ' : default : fprintf ( stderr , " \n " , argv [ 0 ] ) ; exit ( EXIT_FAILURE ) ; } } if ( optind < argc ) { fprintf ( stderr , " \n " , argv [ 0 ] , argv [ optind ] ) ; fprintf ( stderr , " \n " , argv [ 0 ] ) ; exit ( EXIT_FAILURE ) ; } }
parse command line options and save settings in struct
parse command line options and save settings in struct
/* -c, --check        check if the daemon already is
                         running */ /* -d, --debug        don't fork and print debugging to
                         stderr */ /* -n, --nofork       don't fork */ /*     --help         display this help and exit */ /*     --version      output version information and exit
                       */ /* missing required parameter */ /* unknown option character or extraneous parameter */ /* check for remaining arguments */