- }
- 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, "-log")) {
- if (--argc > 0) {
- strncpy(cfg.logfilename, *++argv, sizeof(cfg.logfilename));
- cfg.logfilename[sizeof(cfg.logfilename)-1] = '\0';
- cfg.logtype = LGTYP_DEBUG;
- } else
- err = 1, fprintf(stderr, "pterm: -log expects an argument\n");
- }
- if (!strcmp(p, "-hide")) {
+
+ } else if (!strcmp(p, "-T")) {
+ EXPECTS_ARG;
+ SECOND_PASS_ONLY;
+ strncpy(cfg.wintitle, val, sizeof(cfg.wintitle));
+ cfg.wintitle[sizeof(cfg.wintitle)-1] = '\0';
+
+ } else if (!strcmp(p, "-log")) {
+ EXPECTS_ARG;
+ SECOND_PASS_ONLY;
+ strncpy(cfg.logfilename, val, sizeof(cfg.logfilename));
+ cfg.logfilename[sizeof(cfg.logfilename)-1] = '\0';
+ cfg.logtype = LGTYP_DEBUG;
+
+ } else if (!strcmp(p, "-hide")) {
+ SECOND_PASS_ONLY;