… | |
… | |
26 | #include "../config.h" |
26 | #include "../config.h" |
27 | #include "rxvt.h" |
27 | #include "rxvt.h" |
28 | #include "version.h" |
28 | #include "version.h" |
29 | |
29 | |
30 | #ifdef KEYSYM_RESOURCE |
30 | #ifdef KEYSYM_RESOURCE |
31 | #include "keyboard.h" |
31 | # include "keyboard.h" |
32 | #endif |
32 | #endif |
33 | |
33 | |
34 | /* place holders used for parsing command-line options */ |
34 | /* place holders used for parsing command-line options */ |
35 | #define Optflag_Reverse 0x40000000UL |
35 | #define Optflag_Reverse 0x40000000UL |
36 | #define Optflag_Boolean 0x80000000UL |
36 | #define Optflag_Boolean 0x80000000UL |
37 | #define Optflag_mask 0x3fffffffUL |
37 | #define Optflag_mask 0x3fffffffUL |
38 | |
38 | |
39 | /*{{{ monolithic option/resource structure: */ |
39 | /* monolithic option/resource structure: */ |
40 | /* |
40 | /* |
41 | * `string' options MUST have a usage argument |
41 | * `string' options MUST have a usage argument |
42 | * `switch' and `boolean' options have no argument |
42 | * `switch' and `boolean' options have no argument |
43 | * if there's no desc (ription), it won't appear in rxvt_usage () |
43 | * if there's no desc (ription), it won't appear in rxvt_usage () |
44 | */ |
44 | */ |
… | |
… | |
266 | #undef INFO |
266 | #undef INFO |
267 | #undef STRG |
267 | #undef STRG |
268 | #undef RSTRG |
268 | #undef RSTRG |
269 | #undef SWCH |
269 | #undef SWCH |
270 | #undef BOOL |
270 | #undef BOOL |
271 | /*}}} */ |
|
|
272 | |
271 | |
273 | static const char releasestring[] = "rxvt-unicode (" RXVTNAME ") v" VERSION " - released: " DATE "\n"; |
272 | static const char releasestring[] = "rxvt-unicode (" RXVTNAME ") v" VERSION " - released: " DATE "\n"; |
274 | static const char optionsstring[] = "options: " |
273 | static const char optionsstring[] = "options: " |
275 | #if ENABLE_PERL |
274 | #if ENABLE_PERL |
276 | "perl," |
275 | "perl," |
… | |
… | |
484 | |
483 | |
485 | /*{{{ get command-line options before getting resources */ |
484 | /*{{{ get command-line options before getting resources */ |
486 | void |
485 | void |
487 | rxvt_term::get_options (int argc, const char *const *argv) |
486 | rxvt_term::get_options (int argc, const char *const *argv) |
488 | { |
487 | { |
489 | int i, bad_option = 0; |
488 | int i, bad_option = 0; |
490 | |
489 | |
491 | for (i = 1; i < argc; i++) |
490 | for (i = 1; i < argc; i++) |
492 | { |
491 | { |
493 | unsigned int entry, longopt = 0; |
492 | unsigned int entry, longopt = 0; |
494 | const char *flag, *opt; |
493 | const char *flag, *opt; |
… | |
… | |
541 | * X resources to set these values before we settle for |
540 | * X resources to set these values before we settle for |
542 | * default values |
541 | * default values |
543 | */ |
542 | */ |
544 | |
543 | |
545 | if (optList[entry].doff != -1) |
544 | if (optList[entry].doff != -1) |
|
|
545 | { |
|
|
546 | if (flag == resval_on && !argv [i+1]) |
|
|
547 | rxvt_fatal ("option '%s' needs an argument, aborting.\n", argv [i]); |
|
|
548 | |
546 | rs[optList[entry].doff] = flag == resval_on && argv[i+1] |
549 | rs[optList[entry].doff] = flag == resval_on ? argv[++i] : resval_undef; |
547 | ? argv[++i] : resval_undef; |
550 | } |
548 | } |
551 | } |
549 | else |
552 | else |
550 | { /* boolean value */ |
553 | { /* boolean value */ |
551 | set_option (optList[entry].flag & Optflag_mask, flag == resval_on); |
554 | set_option (optList[entry].flag & Optflag_mask, flag == resval_on); |
552 | |
555 | |