+ while (--argc > 0) {
+ char *p = *++argv;
+ if (!strcmp(p, "-fn")) {
+ if (--argc > 0) {
+ strncpy(cfg.font, *++argv, sizeof(cfg.font));
+ cfg.font[sizeof(cfg.font)-1] = '\0';
+ } else
+ err = 1, fprintf(stderr, "pterm: -fn expects an argument\n");
+ }
+ if (!strcmp(p, "-e")) {
+ if (--argc > 0) {
+ int i;
+ pty_argv = smalloc((argc+1) * sizeof(char *));
+ ++argv;
+ for (i = 0; i < argc; i++)
+ pty_argv[i] = argv[i];
+ pty_argv[argc] = NULL;
+ break; /* finished command-line processing */
+ } else
+ err = 1, fprintf(stderr, "pterm: -e expects an argument\n");
+ }
+ if (!strcmp(p, "-T")) {
+ if (--argc > 0) {
+ strncpy(cfg.wintitle, *++argv, sizeof(cfg.wintitle));
+ cfg.wintitle[sizeof(cfg.wintitle)-1] = '\0';
+ } else
+ err = 1, fprintf(stderr, "pterm: -T expects an argument\n");
+ }
+ if (!strcmp(p, "-hide")) {
+ cfg.hide_mouseptr = 1;
+ }
+ }
+