" --depth=DEPTH Maximum traversal depth (default: 2)\n",
program_invocation_short_name);
}
" --depth=DEPTH Maximum traversal depth (default: 2)\n",
program_invocation_short_name);
}
{ "help", no_argument, NULL, 'h' },
{ "delay", required_argument, NULL, 'd' },
{ "iterations", required_argument, NULL, 'n' },
{ "help", no_argument, NULL, 'h' },
{ "delay", required_argument, NULL, 'd' },
{ "iterations", required_argument, NULL, 'n' },
{ "depth", required_argument, NULL, ARG_DEPTH },
{ NULL, 0, NULL, 0 }
};
{ "depth", required_argument, NULL, ARG_DEPTH },
{ NULL, 0, NULL, 0 }
};
- while ((c = getopt_long(argc, argv, "hptcmin:d:", options, NULL)) >= 0) {
+ while ((c = getopt_long(argc, argv, "hptcmin:bd:", options, NULL)) >= 0) {
- r = read_one_char(stdin, &key, last_refresh + arg_delay - t, NULL);
- if (r == -ETIMEDOUT)
- continue;
- if (r < 0) {
- log_error("Couldn't read key: %s", strerror(-r));
- goto finish;
+ if (arg_batch) {
+ usleep(last_refresh + arg_delay - t);
+ } else {
+ r = read_one_char(stdin, &key,
+ last_refresh + arg_delay - t, NULL);
+ if (r == -ETIMEDOUT)
+ continue;
+ if (r < 0) {
+ log_error("Couldn't read key: %s", strerror(-r));
+ goto finish;
+ }