+ /* Don't display error messages for unknown options. */
+ opterr = 0;
+
+ enable_x11 = 0;
+
+ /*
+ * Glibc violates POSIX by default and skips over non-option arguments and
+ * parses later arguments which look like options as well. But we want to
+ * pass everything except the options unmodified to execvp(). Prefixing
+ * the optstring with "+" fixes this behaver. This is not POSIX
+ * compatible, but the option should be ignored on other systems.
+ */
+ while ((option = getopt(argc, argv, "+Xh")) != -1) {
+ switch (option) {
+ case 'X':
+ enable_x11 = 1;
+ break;
+ case 'h':
+ usage(argv[0]);
+ break;
+ default:
+ fprintf(stderr, "%s: unknown option '%s'!\n\n",
+ argv[0], argv[optind - 1]);
+ usage(argv[0]);
+ break;
+ }
+ }