[BACK]Return to apropos.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/Attic/apropos.c between version 1.5 and 1.6

version 1.5, 2011/11/16 13:23:27 version 1.6, 2011/11/17 14:52:32
Line 22 
Line 22 
 #include <string.h>  #include <string.h>
   
 #include "apropos_db.h"  #include "apropos_db.h"
   #include "man_conf.h"
 #include "mandoc.h"  #include "mandoc.h"
   
 static  int      cmp(const void *, const void *);  static  int      cmp(const void *, const void *);
Line 33 
Line 34 
 int  int
 apropos(int argc, char *argv[])  apropos(int argc, char *argv[])
 {  {
         int              ch;          struct man_conf  dirs;
           int              ch, use_man_conf;
         size_t           terms;          size_t           terms;
         struct opts      opts;          struct opts      opts;
         struct expr     *e;          struct expr     *e;
         extern int       optind;          extern int       optind;
         extern char     *optarg;          extern char     *optarg;
   
           memset(&dirs, 0, sizeof(struct man_conf));
         memset(&opts, 0, sizeof(struct opts));          memset(&opts, 0, sizeof(struct opts));
           use_man_conf = 1;
   
         progname = strrchr(argv[0], '/');          progname = strrchr(argv[0], '/');
         if (progname == NULL)          if (progname == NULL)
Line 48 
Line 52 
         else          else
                 ++progname;                  ++progname;
   
         while (-1 != (ch = getopt(argc, argv, "S:s:")))          while (-1 != (ch = getopt(argc, argv, "M:m:S:s:")))
                 switch (ch) {                  switch (ch) {
                   case ('M'):
                           use_man_conf = 0;
                           /* FALLTHROUGH */
                   case ('m'):
                           manpath_parse(&dirs, optarg);
                           break;
                 case ('S'):                  case ('S'):
                         opts.arch = optarg;                          opts.arch = optarg;
                         break;                          break;
Line 79 
Line 89 
          * The index database is a recno.           * The index database is a recno.
          */           */
   
         apropos_search(&opts, e, terms, NULL, list);          if (use_man_conf)
                   man_conf_parse(&dirs);
           apropos_search(dirs.argc, dirs.argv, &opts,
                           e, terms, NULL, list);
   
           man_conf_free(&dirs);
         exprfree(e);          exprfree(e);
         return(EXIT_SUCCESS);          return(EXIT_SUCCESS);
 }  }
Line 113 
Line 128 
 {  {
   
         fprintf(stderr, "usage: %s "          fprintf(stderr, "usage: %s "
                         "[-I] "                          "[-M path] "
                           "[-m path] "
                         "[-S arch] "                          "[-S arch] "
                         "[-s section] "                          "[-s section] "
                         "EXPR\n",                          "EXPR\n",

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.6