summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-24 22:32:36 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-02-24 23:03:53 +0100
commit84cf9bcc38028696d02c03cd523b7997906b9f01 (patch)
tree508b8765303ef3854fce84083e2509cb791ede9f
parent253e2c0af1f88d38dc92d62d82b230711ef2f874 (diff)
downloadmana-client-84cf9bcc38028696d02c03cd523b7997906b9f01.tar.gz
mana-client-84cf9bcc38028696d02c03cd523b7997906b9f01.tar.bz2
mana-client-84cf9bcc38028696d02c03cd523b7997906b9f01.tar.xz
mana-client-84cf9bcc38028696d02c03cd523b7997906b9f01.zip
Removed a bunch of short options from the command line parameters
They don't have to be specified, so we can leave them out for rarely used options or those for which a single character is rather unclear. Also gave them a bit nicer order, since alphabetical doesn't make much sense. Reviewed-by: Jared Adams
-rw-r--r--src/main.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/main.cpp b/src/main.cpp
index aaa826cb..49122ccf 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -40,26 +40,26 @@ static void printHelp()
using std::endl;
std::cout
- << _("mana [mana-file]") << endl << endl
+ << _("mana [options] [mana-file]") << endl << endl
<< _("Options:") << endl
- << _(" -C --config-file : Configuration file to use") << endl
- << _(" -d --data : Directory to load game data from") << endl
- << _(" -D --default : Choose default character server and "
- "character") << endl
+ << _(" -v --version : Display the version") << endl
<< _(" -h --help : Display this help") << endl
- << _(" -S --home-dir : Directory to use as home directory") << endl
- << _(" -i --screenshot-dir : Directory to store screenshots") << endl
- << _(" -H --update-host : Use this update host") << endl
+ << _(" -C --config-file : Configuration file to use") << endl
+ << _(" -U --username : Login with this username") << endl
<< _(" -P --password : Login with this password") << endl
<< _(" -c --character : Login with this character") << endl
- << _(" -p --port : Login server port") << endl
<< _(" -s --server : Login server name or IP") << endl
+ << _(" -p --port : Login server port") << endl
+ << _(" --update-host : Use this update host") << endl
+ << _(" -D --default : Choose default character server and "
+ "character") << endl
<< _(" -u --skip-update : Skip the update downloads") << endl
- << _(" -U --username : Login with this username") << endl
+ << _(" -d --data : Directory to load game data from") << endl
+ << _(" --home-dir : Directory to use as home directory") << endl
+ << _(" --screenshot-dir : Directory to store screenshots") << endl
#ifdef USE_OPENGL
- << _(" -O --no-opengl : Disable OpenGL for this session") << endl
+ << _(" --no-opengl : Disable OpenGL for this session") << endl;
#endif
- << _(" -v --version : Display the version") << endl;
}
static void printVersion()
@@ -69,7 +69,7 @@ static void printVersion()
static void parseOptions(int argc, char *argv[], Client::Options &options)
{
- const char *optstring = "hvud:U:P:Dc:s:p:C:H:S:Oi:";
+ const char *optstring = "hvud:U:P:Dc:p:C:S:";
const struct option long_options[] = {
{ "config-file", required_argument, 0, 'C' },
@@ -108,7 +108,8 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
case 'D':
options.chooseDefault = true;
break;
- default: // Unknown option
+ case '?': // Unknown option
+ case ':': // Missing argument
case 'h':
options.printHelp = true;
break;
@@ -154,8 +155,6 @@ static void parseOptions(int argc, char *argv[], Client::Options &options)
{
options.brandingPath = argv[optind];
}
-
-
}
#ifdef WIN32