No Subject

Nick Clifton nickc@cygnus.com
Fri Oct 16 10:31:00 GMT 1998


Hi Guys,

I would like to submit the enclosed patch.  It fixes the --help output
so that target specific options are prefixed with -m, and language
specific options which take arguments can be documented as such by
seperating the option name from its argument by a space.  eg

	  "-I <include directory>"

The code will still search for a match against "-I" (only), but the
--help output will include the " <include directory>" as well.

Cheers
	Nick


Fri Oct 16 10:23:17 1998  Nick Clifton  <nickc@cygnus.com>

	* toplev.c (display_help): Prepend '-m' to target specific
	options. 
	(check_lang_option): Ignore text after end of first word of a
	language specific option.


Index: toplev.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/toplev.c,v
retrieving revision 1.111
diff -p -w -r1.111 toplev.c
*** toplev.c	1998/10/16 00:08:44	1.111
--- toplev.c	1998/10/16 17:26:53
*************** display_help ()
*** 4120,4126 ****
  	  else if (description == NULL)
  	    undoc = 1;
  	  else if (* description != 0)
! 	    doc += printf ("  %-23.23s %s\n", option, description);
  	}
        
  #ifdef TARGET_OPTIONS      
--- 4120,4126 ----
  	  else if (description == NULL)
  	    undoc = 1;
  	  else if (* description != 0)
! 	    doc += printf ("  -m%-21.21s %s\n", option, description);
  	}
        
  #ifdef TARGET_OPTIONS      
*************** display_help ()
*** 4134,4140 ****
  	  else if (description == NULL)
  	    undoc = 1;
  	  else if (* description != 0)
! 	    doc += printf ("  %-23.23s %s\n", option, description);
  	}
  #endif
        if (undoc)
--- 4134,4140 ----
  	  else if (description == NULL)
  	    undoc = 1;
  	  else if (* description != 0)
! 	    doc += printf ("  -m%-21.21s %s\n", option, description);
  	}
  #endif
        if (undoc)
*************** check_lang_option (option, lang_option)
*** 4159,4169 ****
--- 4159,4173 ----
    lang_independent_options * indep_options;
    int    len;
    long    k;
+   char * space;
    
    /* Ignore NULL entries.  */
    if (option == NULL || lang_option == NULL)
      return 0;
  
+   if ((space = strchr (lang_option, ' ')) != NULL)
+     len = space - lang_option;
+   else
      len = strlen (lang_option);
    
    /* If they do not match to the first n characters then fail.  */



More information about the Gcc-patches mailing list