+ static const struct option long_options[] = {
+ { "block-size", required_argument, 0, 'b' },
+ { "help", no_argument, 0, 'h' },
+ { "version", no_argument, 0, 'V' },
+ { 0, 0, 0, 0 }
+ };
+
+ int block_size = 32;
+
+ setlocale(LC_ALL, "");
+ for (;;) {
+ int option_index = 0;
+ int c = getopt_long(argc, argv, "b:hV", long_options, &option_index);
+ if (c == -1) {
+ break;
+ }
+ switch (c) {
+ case 'b':
+ block_size = atoi(optarg);
+ break;
+ case 'h':
+ usage();
+ exit(0);
+ case 'v':
+ version();
+ exit(0);
+ default:
+ exit(1);
+ }
+ }
+
+ if (argc - optind != 2) {
+ usage();
+ exit(1);
+ }
+
+ do_build(argv[optind], argv[optind + 1], block_size);