+const static struct option longopts[] = {
+ { "destination-file", required_argument, NULL, 'd' },
+ { NULL, 0, NULL, 0 }
+};
+
+void read_destination_list(char *filename)
+{
+
+}
+
+void parse_options(int argc, char **argv)
+{
+ int option_index = 0;
+
+ for ( ;; ) {
+ int c = getopt_long(argc, argv, "d:", longopts, &option_index);
+ switch (c) {
+ case 'd':
+ read_destination_list(optarg);
+ break;
+ case -1:
+ return; // end of argument list
+ default:
+ fprintf(stderr, "Invalid option\n");
+ exit(1);
+ }
+ }
+}
+