45 _(
"manaplus [options] [manaplus-file]") <<
46 std::endl << std::endl <<
48 _(
"[manaplus-file] : The manaplus file is an XML file (.manaplus)") <<
51 _(
" used to set custom parameters") <<
54 _(
" to the manaplus client.") <<
55 std::endl << std::endl <<
60 _(
" -l --log-file : Log file to use") << std::endl <<
62 _(
" -a --chat-log-dir : Chat log dir to use") << std::endl <<
64 _(
" -v --version : Display the version") << std::endl <<
66 _(
" -h --help : Display this help") << std::endl <<
68 _(
" -C --config-dir : Configuration directory to use") <<
71 _(
" -U --username : Login with this username") <<
74 _(
" -P --password : Login with this password") <<
77 _(
" -c --character : Login with this character") <<
80 _(
" -s --server : Login server name or IP") <<
83 _(
" -y --server-type : Login server type") <<
86 _(
" -p --port : Login server port") <<
89 _(
" -H --update-host : Use this update host") <<
92 _(
" -D --default : Choose default character server and "
96 _(
" -u --skip-update : Skip the update downloads") <<
99 _(
" -d --data : Directory to load game data from") <<
102 _(
" -L --localdata-dir : Directory to use as local "
106 _(
" --screenshot-dir : Directory to store screenshots") <<
109 _(
" --safemode : Start game in safe mode") <<
112 _(
" --renderer : Set renderer type") <<
115 _(
" -T --tests : Start testing drivers and "
116 "auto configuring") <<
119 _(
" -V --validate : Start validating client data") <<
124 _(
" -O --no-opengl : Disable OpenGL for this session") <<
139 const char *
const optstring =
"hvud:U:P:Dc:p:y:l:L:C:s:t:T:a:r:e:V";
141 const option long_options[] =
143 {
"config-dir", required_argument,
nullptr,
'C' },
144 {
"data", required_argument,
nullptr,
'd' },
145 {
"default", no_argument,
nullptr,
'D' },
146 {
"password", required_argument,
nullptr,
'P' },
147 {
"character", required_argument,
nullptr,
'c' },
148 {
"help", no_argument,
nullptr,
'h' },
149 {
"localdata-dir", required_argument,
nullptr,
'L' },
150 {
"update-host", required_argument,
nullptr,
'H' },
151 {
"port", required_argument,
nullptr,
'p' },
152 {
"server", required_argument,
nullptr,
's' },
153 {
"skip-update", no_argument,
nullptr,
'u' },
154 {
"username", required_argument,
nullptr,
'U' },
155 {
"no-opengl", no_argument,
nullptr,
'O' },
156 {
"chat-log-dir", required_argument,
nullptr,
'a' },
157 {
"version", no_argument,
nullptr,
'v' },
158 {
"log-file", required_argument,
nullptr,
'l' },
159 {
"screenshot-dir", required_argument,
nullptr,
'i' },
160 {
"safemode", no_argument,
nullptr,
'm' },
161 {
"tests", no_argument,
nullptr,
'T' },
162 {
"test", required_argument,
nullptr,
't' },
163 {
"renderer", required_argument,
nullptr,
'r' },
164 {
"server-type", required_argument,
nullptr,
'y' },
165 {
"enable-ipc", no_argument,
nullptr,
'I' },
166 {
"hide-cursor", no_argument,
nullptr,
'q' },
167 {
"error", no_argument,
nullptr,
'e' },
168 {
"validate", no_argument,
nullptr,
'V' },
169 {
nullptr, 0,
nullptr, 0 }
174 while (optind < argc)
176 const int result = getopt_long(argc,
248 options.
test.clear();
252 options.
test = std::string(optarg);
267 options.
error =
true;
void parseOptions(const int argc, char *const argv[])
static void printVersion()
bool checkPath(const std::string &path)
std::string strprintf(const char *const format,...)
std::string screenshotDir