[BACK]Return to catman.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/catman.c between version 1.24 and 1.26

version 1.24, 2025/06/29 20:47:01 version 1.26, 2025/06/29 23:51:40
Line 1 
Line 1 
 /*      $Id$ */  /* $Id$ */
 /*  /*
    * Copyright (c) 2017, 2025 Ingo Schwarze <schwarze@openbsd.org>
  * Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org>   * Copyright (c) 2017 Michael Stapelberg <stapelberg@debian.org>
  * Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>  
  *   *
  * Permission to use, copy, modify, and distribute this software for any   * Permission to use, copy, modify, and distribute this software for any
  * purpose with or without fee is hereby granted, provided that the above   * purpose with or without fee is hereby granted, provided that the above
Line 41 
Line 41 
 #include <time.h>  #include <time.h>
 #include <unistd.h>  #include <unistd.h>
   
   int             verbose_flag = 0;
   
 int      process_manpage(int, int, const char *);  int      process_manpage(int, int, const char *);
 int      process_tree(int, int);  int      process_tree(int, int);
 void     run_mandocd(int, const char *, const char *)  void     run_mandocd(int, const char *, const char *)
Line 224  process_tree(int srv_fd, int dstdir_fd)
Line 226  process_tree(int srv_fd, int dstdir_fd)
                         badfiles++;                          badfiles++;
                         break;                          break;
                 default:                  default:
                         warnx("%s: not a regular file", path);                          warnx("file %s: not a regular file", path);
                         fflush(stderr);                          fflush(stderr);
                         badfiles++;                          badfiles++;
                         break;                          break;
Line 234  process_tree(int srv_fd, int dstdir_fd)
Line 236  process_tree(int srv_fd, int dstdir_fd)
                 warn("FATAL: fts_read");                  warn("FATAL: fts_read");
   
         fts_close(ftsp);          fts_close(ftsp);
           if (verbose_flag)
                   warnx("processed %d files in %d directories",
                       goodfiles, gooddirs);
         if (baddirs > 0)          if (baddirs > 0)
                 warnx("skipped %d %s due to errors", baddirs,                  warnx("skipped %d %s due to errors", baddirs,
                     baddirs == 1 ? "directory" : "directories");                      baddirs == 1 ? "directory" : "directories");
Line 258  main(int argc, char **argv)
Line 263  main(int argc, char **argv)
   
         defos = NULL;          defos = NULL;
         outtype = "ascii";          outtype = "ascii";
         while ((opt = getopt(argc, argv, "I:T:")) != -1) {          while ((opt = getopt(argc, argv, "I:T:v")) != -1) {
                 switch (opt) {                  switch (opt) {
                 case 'I':                  case 'I':
                         defos = optarg;                          defos = optarg;
Line 266  main(int argc, char **argv)
Line 271  main(int argc, char **argv)
                 case 'T':                  case 'T':
                         outtype = optarg;                          outtype = optarg;
                         break;                          break;
                   case 'v':
                           verbose_flag = 1;
                           break;
                 default:                  default:
                         usage();                          usage();
                 }                  }
Line 275  main(int argc, char **argv)
Line 283  main(int argc, char **argv)
                 argc -= optind;                  argc -= optind;
                 argv += optind;                  argv += optind;
         }          }
         if (argc != 2)          if (argc != 2) {
                   switch (argc) {
                   case 0:
                           warnx("missing arguments: srcdir and dstdir");
                           break;
                   case 1:
                           warnx("missing argument: dstdir");
                           break;
                   default:
                           warnx("too many arguments: %s", argv[2]);
                           break;
                   }
                 usage();                  usage();
           }
   
         if (socketpair(AF_LOCAL, SOCK_STREAM, AF_UNSPEC, srv_fds) == -1)          if (socketpair(AF_LOCAL, SOCK_STREAM, AF_UNSPEC, srv_fds) == -1)
                 err(1, "socketpair");                  err(1, "socketpair");

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.26

CVSweb