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

  1. #ifndef lint
  2. static char rcsid[] = "$Id: log.c,v 1.9 89/11/19 23:40:37 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.  * Print Log Information
  12.  *
  13.  *    Prints the RCS "log" (rlog) information for the specified
  14.  *    files.  With no argument, prints the log information for
  15.  *    all the files in the directory.
  16.  */
  17.  
  18. #include "cvs.h"
  19.  
  20. log(argc, argv)
  21.     int argc;
  22.     char *argv[];
  23. {
  24.     register int i;
  25.     int numopt, err = 0;
  26.     char *cp;
  27.  
  28.     if (argc == -1)
  29.     log_usage();
  30.     Name_Repository();
  31.     /*
  32.      * All 'log' command options are passed directly on to 'rlog'
  33.      */
  34.     numopt = Get_Options(--argc, ++argv);
  35.     argc -= numopt;
  36.     argv += numopt;
  37.     if (argc == 0) {
  38.     Find_Names(&fileargc, fileargv, ALL);
  39.     argc = fileargc;
  40.     argv = fileargv;
  41.     }
  42.     (void) sprintf(prog, "%s %s", RCS_RLOG, Options);
  43.     cp = prog + strlen(prog);
  44.     for (i = 0; i < argc; i++) {
  45.     (void) strcpy(User, argv[i]);
  46.     Locate_RCS();
  47.     (void) strcpy(cp, " ");
  48.     (void) strcpy(cp+1, Rcs);
  49.     cp += strlen(Rcs) + 1;
  50.     }
  51.     err = system(prog);
  52.     exit(err);
  53. }
  54.  
  55. static
  56. log_usage()
  57. {
  58.     (void) fprintf(stderr,
  59.            "%s %s [rlog-options] [files...]\n", progname, command);
  60.     exit(1);
  61. }
  62.