ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/xdefaults.C
(Generate patch)

Comparing rxvt-unicode/src/xdefaults.C (file contents):
Revision 1.92 by root, Tue Jan 31 19:55:05 2006 UTC vs.
Revision 1.93 by root, Wed Feb 1 21:15:33 2006 UTC

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
273static const char releasestring[] = "rxvt-unicode (" RXVTNAME ") v" VERSION " - released: " DATE "\n"; 272static const char releasestring[] = "rxvt-unicode (" RXVTNAME ") v" VERSION " - released: " DATE "\n";
274static const char optionsstring[] = "options: " 273static 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 */
486void 485void
487rxvt_term::get_options (int argc, const char *const *argv) 486rxvt_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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines