autodriver/autodriver.c
static error_t parse_opt(int key, char *arg, struct argp_state *state) {
    struct arguments *arguments = state->input;

    switch (key) {
    case 'u':
        if (parse_uint(arg, &arguments->nproc) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to nproc must be a nonnegative integer");
        }
        break;
    case 'f':
        if (parse_uint(arg, &arguments->fsize) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to fsize must be a nonnegative integer");
        }
        break;
    case 't':
        if (parse_uint(arg, &arguments->timeout) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to timeout must be a nonnegative integer");
        }
        break;
    case 'o':
        if (parse_uint(arg, &arguments->osize) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to osize must be a nonnegative integer");
        }
        break;
    case 'i':
        if (parse_uint(arg, &arguments->timestamp_interval) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to timestamp-interval must be a nonnegative integer");
        }
        break;
    case 'z':
        args.timezone = arg;
        break;
    case 's':
        args.stream = true;
        break;
    case ARGP_KEY_ARG:
        switch (state->arg_num) {
        case 0:
            arguments->directory = arg;
            break;
        default:
            argp_error(state, "Too many arguments");
            break;
        }
        break;
    case ARGP_KEY_END:
        if (state->arg_num < 1) {
            argp_error(state, "Too few arguments");
        }
        break;
    default:
        return ARGP_ERR_UNKNOWN;
    }

    return 0;
}
/**
 * @brief Argument parsing callback function for argp_parse
 */
@brief Argument parsing callback function for argp_parse
@brief Argument parsing callback function for argp_parse
static error_t parse_opt(int key, char *arg, struct argp_state *state) {
    struct arguments *arguments = state->input;
    switch (key) {
    case 'u':
        if (parse_uint(arg, &arguments->nproc) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to nproc must be a nonnegative integer");
        }
        break;
    case 'f':
        if (parse_uint(arg, &arguments->fsize) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to fsize must be a nonnegative integer");
        }
        break;
    case 't':
        if (parse_uint(arg, &arguments->timeout) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to timeout must be a nonnegative integer");
        }
        break;
    case 'o':
        if (parse_uint(arg, &arguments->osize) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to osize must be a nonnegative integer");
        }
        break;
    case 'i':
        if (parse_uint(arg, &arguments->timestamp_interval) < 0) {
            argp_failure(state, EXIT_USAGE, 0,
                "The argument to timestamp-interval must be a nonnegative integer");
        }
        break;
    case 'z':
        args.timezone = arg;
        break;
    case 's':
        args.stream = true;
        break;
    case ARGP_KEY_ARG:
        switch (state->arg_num) {
        case 0:
            arguments->directory = arg;
            break;
        default:
            argp_error(state, "Too many arguments");
            break;
        }
        break;
    case ARGP_KEY_END:
        if (state->arg_num < 1) {
            argp_error(state, "Too few arguments");
        }
        break;
    default:
        return ARGP_ERR_UNKNOWN;
    }
    return 0;
}
static error_t parse_opt ( int key , char * arg , struct argp_state * state ) { struct arguments * arguments = state -> input ; switch ( key ) { case ' ' : if ( parse_uint ( arg , & arguments -> nproc ) < 0 ) { argp_failure ( state , EXIT_USAGE , 0 , " " ) ; } break ; case ' ' : if ( parse_uint ( arg , & arguments -> fsize ) < 0 ) { argp_failure ( state , EXIT_USAGE , 0 , " " ) ; } break ; case ' ' : if ( parse_uint ( arg , & arguments -> timeout ) < 0 ) { argp_failure ( state , EXIT_USAGE , 0 , " " ) ; } break ; case ' ' : if ( parse_uint ( arg , & arguments -> osize ) < 0 ) { argp_failure ( state , EXIT_USAGE , 0 , " " ) ; } break ; case ' ' : if ( parse_uint ( arg , & arguments -> timestamp_interval ) < 0 ) { argp_failure ( state , EXIT_USAGE , 0 , " " ) ; } break ; case ' ' : args . timezone = arg ; break ; case ' ' : args . stream = true ; break ; case ARGP_KEY_ARG : switch ( state -> arg_num ) { case 0 : arguments -> directory = arg ; break ; default : argp_error ( state , " " ) ; break ; } break ; case ARGP_KEY_END : if ( state -> arg_num < 1 ) { argp_error ( state , " " ) ; } break ; default : return ARGP_ERR_UNKNOWN ; } return 0 ; }
@brief Argument parsing callback function for argp_parse
@brief Argument parsing callback function for argp_parse