Parse command line options */
| 404 | |
| 405 | /* Parse command line options */ |
| 406 | static void |
| 407 | read_options(int argc, char * const argv[], size_t *bufLength, |
| 408 | int *includeNegativeScale, int *includeExabytes, int *verbose) { |
| 409 | int ch; |
| 410 | size_t temp; |
| 411 | |
| 412 | while ((ch = getopt(argc, argv, "nEh?vl:")) != -1) { |
| 413 | switch (ch) { |
| 414 | default: |
| 415 | usage(argv[0]); |
| 416 | exit(1); |
| 417 | break; /* UNREACHABLE */ |
| 418 | case 'h' : |
| 419 | case '?' : |
| 420 | usage(argv[0]); |
| 421 | exit(0); |
| 422 | break; /* UNREACHABLE */ |
| 423 | case 'l' : |
| 424 | sscanf(optarg, "%zu", &temp); |
| 425 | *bufLength = temp + 1; |
| 426 | break; |
| 427 | case 'n' : |
| 428 | *includeNegativeScale = 1; |
| 429 | break; |
| 430 | case 'E' : |
| 431 | *includeExabytes = 1; |
| 432 | break; |
| 433 | case 'v' : |
| 434 | *verbose = 1; |
| 435 | break; |
| 436 | } |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | static struct { |
| 441 | int value; |