46 for (
int i = 1; i < argc; ++i) {
47 const char *arg = argv[i];
48 if (!strcmp(arg,
"-h") || !strcmp(arg,
"--help")) {
52 }
else if (!strcmp(arg,
"--dictionary-path")) {
53 if (!next_path(_dictionary_path, i)) {
56 if (!fs::exists(_dictionary_path)) {
57 std::cerr <<
"--dictionary-path=<PATH> must exist!" << std::endl;
58 std::cerr <<
"--dictionary-path=" << _dictionary_path << std::endl;
62 }
else if (!strcmp(arg,
"--serialization-path")) {
63 if (!next_path(_serialization_path, i)) {
66 }
else if (!strcmp(arg,
"--standard")) {
67 _algorithm = ll::Algorithm::STANDARD;
68 }
else if (!strcmp(arg,
"--transposition")) {
69 _algorithm = ll::Algorithm::TRANSPOSITION;
70 }
else if (!strcmp(arg,
"--merge-and-split")) {
71 _algorithm = ll::Algorithm::MERGE_AND_SPLIT;
72 }
else if (!strcmp(arg,
"--max-distance")) {
74 std::cerr <<
"Not enough command-line args!" << std::endl;
78 std::stringstream stream(argv[i + 1]);
79 stream >> _max_distance;
82 std::cerr <<
"Invalid argument: " << arg << std::endl;
89 if (!fs::exists(_dictionary_path) && !fs::exists(_serialization_path)) {
90 std::cerr <<
"Either --dictionary-path=<PATH> or "
91 "--serialization-path=<PATH> must exist"
93 std::cerr <<
"--dictionary-path=" << _dictionary_path << std::endl;
94 std::cerr <<
"--serialization-path=" << _serialization_path << std::endl;