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.165 by root, Mon Jun 4 15:18:53 2012 UTC vs.
Revision 1.166 by root, Tue Jun 5 19:32:29 2012 UTC

392const char rxvt_term::resval_on [] = "on"; 392const char rxvt_term::resval_on [] = "on";
393const char rxvt_term::resval_off [] = "off"; 393const char rxvt_term::resval_off [] = "off";
394 394
395/*{{{ usage: */ 395/*{{{ usage: */
396/*----------------------------------------------------------------------*/ 396/*----------------------------------------------------------------------*/
397static void 397void
398rxvt_usage (int type) 398rxvt_term::rxvt_usage (int type)
399{ 399{
400 unsigned int i, col; 400 unsigned int i, col;
401 401
402 rxvt_log ("%s%s%s", releasestring, optionsstring, RESNAME); 402 rxvt_log ("%s%s%s", releasestring, optionsstring, RESNAME);
403 403
411 { 411 {
412 int len = 0; 412 int len = 0;
413 413
414 if (optList[i].arg) 414 if (optList[i].arg)
415 len = strlen (optList[i].arg) + 1; 415 len = strlen (optList[i].arg) + 1;
416
416 assert (optList[i].opt != NULL); 417 assert (optList[i].opt != NULL);
417 len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2 : 0); 418 len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2 : 0);
418 col += len; 419 col += len;
420
419 if (col > 79) 421 if (col > 79)
420 { 422 {
421 /* assume regular width */ 423 /* assume regular width */
422 rxvt_log ("\n"); 424 rxvt_log ("\n");
423 col = 1 + len; 425 col = 1 + len;
424 } 426 }
425 427
426 rxvt_log (" [-%s%s", (optList_isBool (i) ? "/+" : ""), optList[i].opt); 428 rxvt_log (" [-%s%s", (optList_isBool (i) ? "/+" : ""), optList[i].opt);
429
427 if (optList[i].arg) 430 if (optList[i].arg)
428 rxvt_log (" %s]", optList[i].arg); 431 rxvt_log (" %s]", optList[i].arg);
429 else 432 else
430 rxvt_log ("]"); 433 rxvt_log ("]");
431 } 434 }
461 (optList_isBool (i) ? "boolean" : optList[i].arg)); 464 (optList_isBool (i) ? "boolean" : optList[i].arg));
462 rxvt_log ("\n -help to list options"); 465 rxvt_log ("\n -help to list options");
463 break; 466 break;
464 } 467 }
465 468
469#if ENABLE_PERL
470 if (type) // do not initialise perl for type == 0, as perl does not have "short" options
471 {
472 rxvt_perl.init (this);
473 rxvt_perl.usage (type);
474 }
475#endif
476
466 rxvt_log ("\n\n"); 477 rxvt_log ("\n\n");
467 rxvt_exit_failure (); 478 rxvt_exit_failure ();
468} 479}
469 480
470/*}}} */ 481/*}}} */
573 584
574 return (const char **)argv + i + 1; 585 return (const char **)argv + i + 1;
575 } 586 }
576 else 587 else
577 { 588 {
589#if ENABLE_PERL
590 rxvt_perl.init (this);
591
592 if (int flags = rxvt_perl.resource (this, opt, true, longopt, flag, argv [i + 1]))
593 {
594 if ((!flags & rxvt_perl.RESOURCE_BOOLEAN))
595 {
596 if (flag && i + 1 == argc)
597 rxvt_fatal ("option '%s' requires an argument, aborting.\n", argv [i]);
598
599 ++i;
600 }
601 }
602 else
603#endif
604 {
578 bad_option = 1; 605 bad_option = 1;
579 rxvt_warn ("\"%s\": unknown or malformed option.\n", opt); 606 rxvt_warn ("\"%s\": unknown or malformed option.\n", opt);
607 }
580 } 608 }
581 } 609 }
582 610
583 if (bad_option) 611 if (bad_option)
584 rxvt_usage (0); 612 rxvt_usage (0);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines