+ case 0: /* options which are long only */
+ if (strcmp (long_options[option_index].name, "listen") == 0)
+ remote_control_listen = 1;
+ else if (strcmp (long_options[option_index].name, "remote") == 0) {
+ if (optarg) {
+ if (sscanf (optarg, "%d", &remote_control) != 1) {
+ fprintf (stderr, _("guestfish: --listen=PID: PID was not a number: %s\n"), optarg);
+ exit (1);
+ }
+ } else {
+ p = getenv ("GUESTFISH_PID");
+ if (!p || sscanf (p, "%d", &remote_control) != 1) {
+ fprintf (stderr, _("guestfish: remote: $GUESTFISH_PID must be set to the PID of the remote process\n"));
+ exit (1);
+ }
+ }
+ } else {
+ fprintf (stderr, _("guestfish: unknown long option: %s (%d)\n"),
+ long_options[option_index].name, option_index);
+ exit (1);
+ }
+ break;
+