… | |
… | |
384 | #if defined(XTERM_SCROLLBAR) |
384 | #if defined(XTERM_SCROLLBAR) |
385 | "+xterm" |
385 | "+xterm" |
386 | #endif |
386 | #endif |
387 | "\nUsage: "; /* Usage */ |
387 | "\nUsage: "; /* Usage */ |
388 | |
388 | |
389 | #define INDENT 18 |
389 | #define INDENT 28 |
390 | |
390 | |
391 | const char rxvt_term::resval_undef [] = "<undef>"; |
391 | const char rxvt_term::resval_undef [] = "<undef>"; |
392 | const char rxvt_term::resval_on [] = "on"; |
392 | const char rxvt_term::resval_on [] = "on"; |
393 | const char rxvt_term::resval_off [] = "off"; |
393 | const char rxvt_term::resval_off [] = "off"; |
394 | |
394 | |
… | |
… | |
464 | |
464 | |
465 | for (i = 0; i < ecb_array_length (optList); i++) |
465 | for (i = 0; i < ecb_array_length (optList); i++) |
466 | if (optList[i].kw != NULL) |
466 | if (optList[i].kw != NULL) |
467 | rxvt_log (" %s: %*s%s\n", |
467 | rxvt_log (" %s: %*s%s\n", |
468 | optList[i].kw, |
468 | optList[i].kw, |
469 | (INDENT - strlen (optList[i].kw)), "", /* XXX */ |
469 | (INDENT + 2 - strlen (optList[i].kw)), "", /* XXX */ |
470 | (optList_isBool (i) ? "boolean" : optList[i].arg)); |
470 | (optList_isBool (i) ? "boolean" : optList[i].arg)); |
471 | |
471 | |
472 | #if ENABLE_PERL |
472 | #if ENABLE_PERL |
473 | rxvt_perl.init (this); |
473 | rxvt_perl.init (this); |
474 | rxvt_perl.usage (this, 2); |
474 | rxvt_perl.usage (this, 2); |
… | |
… | |
546 | * default values |
546 | * default values |
547 | */ |
547 | */ |
548 | |
548 | |
549 | if (optList[entry].doff != -1) |
549 | if (optList[entry].doff != -1) |
550 | { |
550 | { |
551 | if (flag && i+1 == argc) |
551 | if (flag && i + 1 == argc) |
552 | rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]); |
552 | rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]); |
553 | |
553 | |
554 | rs[optList[entry].doff] = flag ? argv[++i] : resval_undef; |
554 | rs[optList[entry].doff] = flag ? argv[++i] : resval_undef; |
555 | } |
555 | } |
556 | } |
556 | } |
… | |
… | |
564 | } |
564 | } |
565 | } |
565 | } |
566 | #ifndef NO_RESOURCES |
566 | #ifndef NO_RESOURCES |
567 | else if (!strcmp (opt, "xrm")) |
567 | else if (!strcmp (opt, "xrm")) |
568 | { |
568 | { |
569 | if (i+1 < argc) |
569 | if (i + 1 < argc) |
570 | XrmPutLineResource (&option_db, argv[++i]); |
570 | XrmPutLineResource (&option_db, argv[++i]); |
571 | } |
571 | } |
572 | #endif |
572 | #endif |
573 | #ifdef KEYSYM_RESOURCE |
573 | #ifdef KEYSYM_RESOURCE |
574 | else if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1)) |
574 | else if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1)) |
575 | { |
575 | { |
576 | if (i+1 < argc) |
576 | if (i + 1 < argc) |
577 | { |
577 | { |
578 | char *res = rxvt_temp_buf<char> (strlen (opt) + strlen (argv[++i]) + 6); |
578 | char *res = rxvt_temp_buf<char> (strlen (opt) + strlen (argv[++i]) + 6); |
579 | sprintf (res, "*.%s: %s\n", opt, argv[i]); |
579 | sprintf (res, "*.%s: %s\n", opt, argv[i]); |
580 | XrmPutLineResource (&option_db, res); |
580 | XrmPutLineResource (&option_db, res); |
581 | } |
581 | } |
582 | } |
582 | } |
583 | #endif |
583 | #endif |
584 | else if (!strcmp (opt, "e")) |
584 | else if (!strcmp (opt, "e")) |
585 | { |
585 | { |
586 | if (i+1 == argc) |
586 | if (i + 1 < argc) |
587 | rxvt_fatal ("option '-e' requires an argument, aborting.\n"); |
|
|
588 | |
|
|
589 | return (const char **)argv + i + 1; |
587 | return (const char **)argv + i + 1; |
|
|
588 | |
|
|
589 | rxvt_warn ("option '-e' requires an argument, aborting.\n"); |
|
|
590 | bad_option = 1; |
590 | } |
591 | } |
591 | else |
592 | else |
592 | { |
593 | { |
593 | #if ENABLE_PERL |
594 | #if ENABLE_PERL |
594 | rxvt_perl.init (this); |
595 | rxvt_perl.init (this); |
595 | |
596 | |
596 | if (int flags = rxvt_perl.resource (this, opt, true, longopt, flag, argv [i + 1])) |
597 | if (int flags = rxvt_perl.parse_resource (this, opt, true, longopt, flag, argv [i + 1])) |
597 | { |
598 | { |
598 | if ((!flags & rxvt_perl.RESOURCE_BOOLEAN)) |
599 | if (flags & rxvt_perl.RESOURCE_ARG) |
599 | { |
600 | { |
600 | if (flag && i + 1 == argc) |
601 | if (i + 1 == argc) |
|
|
602 | { |
601 | rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]); |
603 | rxvt_warn ("option '%s' requires an argument.\n", argv [i]); |
602 | |
604 | bad_option = 1; |
|
|
605 | } |
|
|
606 | else |
603 | ++i; |
607 | ++i; |
604 | } |
608 | } |
605 | } |
609 | } |
606 | else |
610 | else |
607 | #endif |
611 | #endif |
608 | { |
612 | { |
|
|
613 | rxvt_warn ("\"%s\": unknown or malformed option.\n", opt); |
609 | bad_option = 1; |
614 | bad_option = 1; |
610 | rxvt_warn ("\"%s\": unknown or malformed option.\n", opt); |
|
|
611 | } |
615 | } |
612 | } |
616 | } |
613 | } |
617 | } |
614 | |
618 | |
615 | if (bad_option) |
619 | if (bad_option) |