- while (1) {
- int option_index = 0;
- c = getopt_long(argc, argv, "arf:h", options, &option_index);
- if (c == -1) break;
-
- switch (c) {
- case 'a': mode = ABSOLUTE; break;
- case 'r': mode = REMAINING; break;
- case 'f':
- strncpy(file, optarg, 255);
- file[254] = '\0';
- break;
- case 'h':
- printf("Usage: dumpleases -f <file> -[r|a]\n\n");
- printf(" -f, --file=FILENAME Leases file to load\n");
- printf(" -r, --remaining Interepret lease times as time remaing\n");
- printf(" -a, --absolute Interepret lease times as expire time\n");
- break;
- }
- }
-
- if (!(fp = fopen(file, "r"))) {
- perror("could not open input file");
- return 0;
- }
+ applet_long_options = dumpleases_longopts;
+#endif
+ opt_complementary = "=0:a--r:r--a";
+ opt = getopt32(argv, "arf:", &file);