+ // Parse options.
+ int state_fd = -1;
+ for ( ;; ) {
+ static const option long_options[] = {
+ { "state", required_argument, 0, 's' },
+ };
+ int option_index = 0;
+ int c = getopt_long (argc, argv, "s:", long_options, &option_index);
+
+ if (c == -1) {
+ break;
+ }
+ switch (c) {
+ case 's':
+ state_fd = atoi(optarg);
+ break;
+ default:
+ assert(false);
+ }
+ }
+
+ string config_filename = "cubemap.config";
+ if (optind < argc) {
+ config_filename = argv[optind++];
+ }
+