+ static const struct option long_options[] = {
+ { "block-size", required_argument, 0, 'b' },
+ { "plaintext", no_argument, 0, 'p' },
+ { "help", no_argument, 0, 'h' },
+ { "version", no_argument, 0, 'V' },
+ { "debug", no_argument, 0, 'D' }, // Not documented.
+ { 0, 0, 0, 0 }
+ };
+
+ int block_size = 32;
+ bool plaintext = false;
+
+ setlocale(LC_ALL, "");
+ for (;;) {
+ int option_index = 0;
+ int c = getopt_long(argc, argv, "b:hpVD", long_options, &option_index);
+ if (c == -1) {
+ break;
+ }
+ switch (c) {
+ case 'b':
+ block_size = atoi(optarg);
+ break;
+ case 'p':
+ plaintext = true;
+ break;
+ case 'h':
+ usage();
+ exit(0);
+ case 'V':
+ version();
+ exit(0);
+ case 'D':
+ use_debug = true;
+ break;
+ default:
+ exit(1);
+ }
+ }
+
+ if (argc - optind != 2) {
+ usage();
+ exit(1);
+ }
+
+ do_build(argv[optind], argv[optind + 1], block_size, plaintext);