+ for (;;)
+ {
+ static const struct option long_options[] =
+ {
+ { "data", optional_argument, NULL, 'd' },
+ { "help", no_argument, NULL, 'h' },
+ { "version", no_argument, NULL, 'v' },
+ { NULL, 0, NULL, 0 },
+ };
+
+ int c;
+
+ c = getopt_long (argc, argv, "d::hv", long_options, NULL);
+ if (c == -1)
+ break;
+
+ switch (c)
+ {
+ case 'd':
+ max_cases = optarg ? atoi (optarg) : INT_MAX;
+ break;
+
+ case 'v':
+ version_etc (stdout, "pspp-dump-sav", PACKAGE_NAME, PACKAGE_VERSION,
+ "Ben Pfaff", "John Darrington", NULL_SENTINEL);
+ exit (EXIT_SUCCESS);
+
+ case 'h':
+ usage ();
+ exit (EXIT_SUCCESS);
+
+ default:
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ if (optind == argc)
+ error (1, 0, "at least one non-option argument is required; "
+ "use --help for help");
+
+ for (i = optind; i < argc; i++)