Add documentation regarding storage
[dueringa_WikiWalker.git] / src / main.cpp
blob7150d7a98f28924737051eba328c54312f57ddd7
1 #include <iostream>
2 #include "WikiWalker.h"
4 using namespace std;
6 void usage(string exename);
8 int main(int argc, char** argv)
10 if(argc != 2) {
11 usage(argv[0]);
12 return -1;
15 if(std::string("-v") == argv[1] || std::string("--version") == argv[1]) {
16 std::cout << "WikiWalker, version " << _WW_VERSION << std::endl;
17 return 0;
20 string url = argv[1];
22 try {
23 WikiWalker w = WikiWalker();
24 w.startWalking(url);
25 } catch(std::exception& e) {
26 cout << "Error " << e.what() << endl;
27 return -1;
30 return 0;
33 void usage(string exename)
35 cout << "Usage: " << endl;
36 cout << exename << " [URL]" << endl;
37 cout << exename << " -v" << endl;