home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / rcs / sources / options.c < prev    next >
C/C++ Source or Header  |  1992-01-19  |  862b  |  38 lines

  1. #ifndef lint
  2. static char rcsid[] = "$Id: options.c,v 1.5 89/11/19 23:20:18 berliner Exp $";
  3. #endif 
  4.  
  5. /*
  6.  *    Copyright (c) 1989, Brian Berliner
  7.  *
  8.  *    You may distribute under the terms of the GNU General Public License
  9.  *    as specified in the README file that comes with the CVS 1.0 kit.
  10.  *
  11.  * Get Options
  12.  *
  13.  * Collects options from argc/argv and stuffs them into the
  14.  * global Options variable.
  15.  *
  16.  * Returns the number of options grabbed.
  17.  */
  18.  
  19. #include "cvs.h"
  20.  
  21. Get_Options(argc, argv)
  22.     int argc;
  23.     char *argv[];
  24. {
  25.     register int i;
  26.     register int numopts = 0;
  27.  
  28.     Options[0] = '\0';            /* Assume none */
  29.     for (i = 0; i < argc; i++) {
  30.     if (argv[i][0] == '-' || argv[i][0] == '\0') {
  31.         numopts++;
  32.         (void) strcat(Options, " ");
  33.         (void) strcat(Options, argv[i]);
  34.     }
  35.     }
  36.     return (numopts);
  37. }
  38.