Github user cestella commented on a diff in the pull request: https://github.com/apache/incubator-metron/pull/509#discussion_r109923417 --- Diff: metron-sensors/fastcapa/src/args.c --- @@ -84,62 +95,167 @@ int parse_args(int argc, char** argv) // parse arguments to this application argvopt = argv; - while ((opt = getopt_long(argc, argvopt, "p:b:t:c:", lgopts, &option_index)) != EOF) { + while ((opt = getopt_long(argc, argvopt, "hp:b:t:c:r:q:s:x:", lgopts, &option_index)) != EOF) { switch (opt) { - // portmask - case 'p': - app.enabled_port_mask = parse_portmask(optarg); - if (app.enabled_port_mask == 0) { - printf("Error: Invalid portmask: '%s'\n", optarg); - print_usage(prgname); + // help + case 'h': + print_usage(); return -1; - } - break; - - // kafka topic - case 't': - app.kafka_topic = strdup(optarg); - if (!valid(app.kafka_topic)) { - printf("Error: Invalid kafka topic: '%s'\n", optarg); - print_usage(prgname); - return -1; - } - break; - - // kafka config path - case 'c': - app.kafka_config_path = strdup(optarg); - if (!valid(app.kafka_config_path) || !file_exists(app.kafka_config_path)) { - printf("Error: Invalid kafka config: '%s'\n", optarg); - print_usage(prgname); - return -1; - } - break; - - default: - printf("Error: Invalid argument: '%s'\n", optarg); - print_usage(prgname); - return -1; - } + + // burst size + case 'b': + app.burst_size = atoi(optarg); + printf("[ -b BURST_SIZE ] defined as %d \n", app.burst_size); + + if(app.burst_size < 1 || app.burst_size > MAX_BURST_SIZE) { + printf("Invalid burst size; burst=%u must be in [1, %u]. \n", app.burst_size, MAX_BURST_SIZE); --- End diff -- Actually, same comment on the error comments below.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---