ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/proj/trunk/Search/Search.cpp
(Generate patch)

Comparing trunk/Search/Search.cpp (file contents):
Revision 1 by douglas, 2002-12-04T20:22:59-08:00 vs.
Revision 37 by douglas, 2003-01-16T22:24:01-08:00

# Line 1 | Line 1
1   /* ============================================================================
2   * Douglas Thrift's Search Engine License
3   *
4 < * Copyright (C) 2002, Douglas Thrift. All Rights Reserved.
4 > * Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved.
5   * Redistribution and use in source and binary forms, with or without
6   * modification, are permitted provided that the following conditions are met:
7   *
# Line 61 | Line 61
61  
62   string program;
63   string programName = "Douglas Thrift's Search Engine";
64 < string programVersion = "1.1alpha";
64 > string programVersion = "1.1beta1";
65   bool debug = false;
66  
67   int main(int argc, char* argv[])
# Line 84 | Line 84 | int main(int argc, char* argv[])
84          string notfound = "notfound.html";
85          string pages = "pages.html";
86  
87 +        string email;
88 +
89          for (int index = 1; index < argc; index++)
90          {
91                  string arg(argv[index]);
# Line 112 | Line 114 | int main(int argc, char* argv[])
114                          else
115                          {
116                                  cerr << program << ": Bad arguments\n";
117 +                                usage();
118                                  return 1;
119                          }
120                  }
# Line 126 | Line 129 | int main(int argc, char* argv[])
129                          else
130                          {
131                                  cerr << program << ": Bad arguments\n";
132 +                                usage();
133                                  return 1;
134                          }
135                  }
# Line 138 | Line 142 | int main(int argc, char* argv[])
142                          else
143                          {
144                                  cerr << program << ": Bad arguments\n";
145 +                                usage();
146                                  return 1;
147                          }
148                  }
# Line 150 | Line 155 | int main(int argc, char* argv[])
155                          else
156                          {
157                                  cerr << program << ": Bad arguments\n";
158 +                                usage();
159                                  return 1;
160                          }
161                  }
# Line 162 | Line 168 | int main(int argc, char* argv[])
168                          else
169                          {
170                                  cerr << program << ": Bad arguments\n";
171 +                                usage();
172                                  return 1;
173                          }
174                  }
# Line 174 | Line 181 | int main(int argc, char* argv[])
181                          else
182                          {
183                                  cerr << program << ": Bad arguments\n";
184 +                                usage();
185                                  return 1;
186                          }
187                  }
# Line 186 | Line 194 | int main(int argc, char* argv[])
194                          else
195                          {
196                                  cerr << program << ": Bad arguments\n";
197 +                                usage();
198                                  return 1;
199                          }
200                  }
# Line 198 | Line 207 | int main(int argc, char* argv[])
207                          else
208                          {
209                                  cerr << program << ": Bad arguments\n";
210 +                                usage();
211                                  return 1;
212                          }
213                  }
# Line 210 | Line 220 | int main(int argc, char* argv[])
220                          else
221                          {
222                                  cerr << program << ": Bad arguments\n";
223 +                                usage();
224                                  return 1;
225                          }
226                  }
# Line 235 | Line 246 | int main(int argc, char* argv[])
246                  {
247                          cerr << program << ": Too many indices, can only build one index"
248                                  << " at a time\n";
249 +                        usage();
250                          return 1;
251                  }
252  
253                  if (indexDomains.size() < 1)
254                  {
255                          cerr << program << ": Must specify at least one domain\n";
256 +                        usage();
257                          return 1;
258                  }
259  
# Line 267 | Line 280 | int main(int argc, char* argv[])
280          return 0;
281   }
282  
283 + string agent(bool version)
284 + {
285 +        string agent = programName + (version ? ('/' + programVersion) : "");
286 +
287 +        return agent;
288 + }
289 +
290   string platform()
291   {
292          string platform;
# Line 399 | Line 419 | void usage()
419   void version()
420   {
421          cout << programName << " " << programVersion << " "<< platform() << "\n\n"
422 <                << "   Copyright (C) 2002, Douglas Thrift. All Rights Reserved.\n\n"
422 >                << "   Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved.\n"
423 >                << "\n"
424                  << "   This product includes software developed by Douglas Thrift\n"
425                  << "   (http://computers.douglasthrift.net/searchengine/).\n";
426   }
# Line 408 | Line 429 | void license()
429   {
430          cout << "License:\n"
431                  << "   Douglas Thrift's Search Engine License\n\n"
432 <                << "   Copyright (C) 2002, Douglas Thrift. All Rights Reserved.\n\n"
432 >                << "   Copyright (C) 2002-2003, Douglas Thrift. All Rights Reserved.\n"
433 >                << "\n"
434                  << "   Redistribution and use in source and binary forms, with or with"
435                  << "out\n"
436                  << "   modification, are permitted provided that the following conditi"

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines