Switch to unified view

a/src/index/recollindex.cpp b/src/index/recollindex.cpp
1
#ifndef lint
1
#ifndef lint
2
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.33 2007-06-08 16:47:19 dockes Exp $ (C) 2004 J.F.Dockes";
2
static char rcsid[] = "@(#$Id: recollindex.cpp,v 1.34 2007-07-10 09:23:28 dockes Exp $ (C) 2004 J.F.Dockes";
3
#endif
3
#endif
4
/*
4
/*
5
 *   This program is free software; you can redistribute it and/or modify
5
 *   This program is free software; you can redistribute it and/or modify
6
 *   it under the terms of the GNU General Public License as published by
6
 *   it under the terms of the GNU General Public License as published by
7
 *   the Free Software Foundation; either version 2 of the License, or
7
 *   the Free Software Foundation; either version 2 of the License, or
...
...
214
#define OPT_m     0x80
214
#define OPT_m     0x80
215
#define OPT_D     0x100
215
#define OPT_D     0x100
216
#define OPT_e     0x200
216
#define OPT_e     0x200
217
#define OPT_w     0x400
217
#define OPT_w     0x400
218
#define OPT_x     0x800
218
#define OPT_x     0x800
219
#define OPT_l     0x1000
219
220
220
static const char usage [] =
221
static const char usage [] =
221
"\n"
222
"\n"
222
"recollindex [-h] \n"
223
"recollindex [-h] \n"
223
"    Print help\n"
224
"    Print help\n"
...
...
232
#endif
233
#endif
233
"recollindex -e <filename [filename ...]>\n"
234
"recollindex -e <filename [filename ...]>\n"
234
"    Purge data for individual files. No stem database updates\n"
235
"    Purge data for individual files. No stem database updates\n"
235
"recollindex -i <filename [filename ...]>\n"
236
"recollindex -i <filename [filename ...]>\n"
236
"    Index individual files. No database purge or stem database updates\n"
237
"    Index individual files. No database purge or stem database updates\n"
238
"recollindex -l\n"
239
"    List available stemming languages\n"
237
"recollindex -s <lang>\n"
240
"recollindex -s <lang>\n"
238
"    Build stem database for additional language <lang>\n"
241
"    Build stem database for additional language <lang>\n"
239
#ifdef RCL_USE_ASPELL
242
#ifdef RCL_USE_ASPELL
240
"recollindex -S\n"
243
"recollindex -S\n"
241
"    Build aspell spelling dictionary.>\n"
244
"    Build aspell spelling dictionary.>\n"
...
...
280
        case 'D': op_flags |= OPT_D; break;
283
        case 'D': op_flags |= OPT_D; break;
281
#endif
284
#endif
282
        case 'e': op_flags |= OPT_e; break;
285
        case 'e': op_flags |= OPT_e; break;
283
        case 'h': op_flags |= OPT_h; break;
286
        case 'h': op_flags |= OPT_h; break;
284
        case 'i': op_flags |= OPT_i; break;
287
        case 'i': op_flags |= OPT_i; break;
288
      case 'l': op_flags |= OPT_l; break;
285
#ifdef RCL_MONITOR
289
#ifdef RCL_MONITOR
286
        case 'm': op_flags |= OPT_m; break;
290
        case 'm': op_flags |= OPT_m; break;
287
#endif
291
#endif
288
        case 's': op_flags |= OPT_s; break;
292
        case 's': op_flags |= OPT_s; break;
289
#ifdef RCL_USE_ASPELL
293
#ifdef RCL_USE_ASPELL
...
...
336
    if (op_flags & OPT_i)
340
    if (op_flags & OPT_i)
337
        exit(!indexfiles(config, filenames));
341
        exit(!indexfiles(config, filenames));
338
    else 
342
    else 
339
        exit(!purgefiles(config, filenames));
343
        exit(!purgefiles(config, filenames));
340
344
345
    } else if (op_flags & OPT_l) {
346
  if (argc != 0) 
347
      Usage();
348
  list<string> stemmers = DbIndexer::getStemmerNames();
349
  for (list<string>::const_iterator it = stemmers.begin(); 
350
       it != stemmers.end(); it++) {
351
      cout << *it << endl;
352
  }
353
  exit(0);
341
    } else if (op_flags & OPT_s) {
354
    } else if (op_flags & OPT_s) {
342
    if (argc != 1) 
355
    if (argc != 1) 
343
        Usage();
356
        Usage();
344
    string lang = *argv++; argc--;
357
    string lang = *argv++; argc--;
345
    exit(!createstemdb(config, lang));
358
    exit(!createstemdb(config, lang));