135 |
// 2) Make sure the mandatory options are present |
// 2) Make sure the mandatory options are present |
136 |
if (!found_d || !found_m) |
if (!found_d || !found_m) |
137 |
{ |
{ |
138 |
cerr << "Mandatory option missing: "; |
std::cerr << "Mandatory option missing: "; |
139 |
if (!found_d) |
if (!found_d) |
140 |
cerr << "dict"; |
std::cerr << "dict"; |
141 |
else if (!found_m) |
else if (!found_m) |
142 |
cerr << "mode"; |
std::cerr << "mode"; |
143 |
cerr << "\n"; |
std::cerr << "\n"; |
144 |
|
|
145 |
printUsage(argv[0]); |
printUsage(argv[0]); |
146 |
return NULL; |
return NULL; |
199 |
void GameFactory::printUsage(const std::string &iBinaryName) const |
void GameFactory::printUsage(const std::string &iBinaryName) const |
200 |
{ |
{ |
201 |
std::cout << "Usage: " << iBinaryName << " [options]\n" |
std::cout << "Usage: " << iBinaryName << " [options]\n" |
202 |
<< "\n" |
<< "\n" |
203 |
<< " -h, --help Print this help and exit\n" |
<< " -h, --help Print this help and exit\n" |
204 |
<< " -v, --version Print version information and exit\n" |
<< " -v, --version Print version information and exit\n" |
205 |
<< " -m, --mode {duplicate,d,freegame,f,training,t}\n" |
<< " -m, --mode {duplicate,d,freegame,f,training,t}\n" |
206 |
<< " Choose game mode\n" |
<< " Choose game mode\n" |
207 |
<< " -d, --dict <string> Choose a dictionary\n" |
<< " -d, --dict <string> Choose a dictionary\n" |
208 |
<< " --human Add a human player\n" |
<< " --human Add a human player\n" |
209 |
<< " --ai Add a AI (Artificial Intelligence) player\n" |
<< " --ai Add a AI (Artificial Intelligence) player\n" |
210 |
<< " --joker Play with the \"Joker game\" variant\n"; |
<< " --joker Play with the \"Joker game\" variant\n"; |
211 |
} |
} |
212 |
|
|
213 |
|
|
214 |
void GameFactory::printVersion() const |
void GameFactory::printVersion() const |
215 |
{ |
{ |
216 |
std::cout << PACKAGE_STRING << "\n" |
std::cout << PACKAGE_STRING << "\n" |
217 |
<< "This program comes with NO WARRANTY, to the extent permitted by " |
<< "This program comes with NO WARRANTY, to the extent permitted by " |
218 |
<< "law.\nYou may redistribute it under the terms of the GNU General " |
<< "law.\nYou may redistribute it under the terms of the GNU General " |
219 |
<< "Public License;\nsee the file named COPYING for details.\n"; |
<< "Public License;\nsee the file named COPYING for details.\n"; |
220 |
} |
} |
221 |
|
|
222 |
|
|