Add descriptions to command line arguments
authorJuhani Numminen <juhaninumminen0@gmail.com>
Fri, 27 Jan 2012 12:56:45 +0000 (14:56 +0200)
committerPerttu Ahola <celeron55@gmail.com>
Tue, 28 Feb 2012 19:03:45 +0000 (21:03 +0200)
src/main.cpp
src/servermain.cpp

index 6cb9cf98419744493a2b017e440f5925d4dcabd3..2875474f1dede85f213ccc7d5d04ec2450b82071 100644 (file)
@@ -1085,22 +1085,31 @@ int main(int argc, char *argv[])
        
        // List all allowed options
        core::map<std::string, ValueSpec> allowed_options;
-       allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG));
+       allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG,
+                       "Show allowed options"));
        allowed_options.insert("server", ValueSpec(VALUETYPE_FLAG,
                        "Run server directly"));
        allowed_options.insert("config", ValueSpec(VALUETYPE_STRING,
                        "Load configuration from specified file"));
-       allowed_options.insert("port", ValueSpec(VALUETYPE_STRING));
-       allowed_options.insert("address", ValueSpec(VALUETYPE_STRING));
-       allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG));
-       allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG));
-       allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG));
-       allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING));
+       allowed_options.insert("port", ValueSpec(VALUETYPE_STRING,
+                       "Set network port to connect to"));
+       allowed_options.insert("address", ValueSpec(VALUETYPE_STRING,
+                       "Address to connect to"));
+       allowed_options.insert("random-input", ValueSpec(VALUETYPE_FLAG,
+                       "Enable random user input, for testing"));
+       allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG,
+                       "Disable unit tests"));
+       allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG,
+                       "Enable unit tests"));
+       allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING,
+                       "Map directory (where everything in the world is stored)"));
 #ifdef _WIN32
        allowed_options.insert("dstream-on-stderr", ValueSpec(VALUETYPE_FLAG));
 #endif
-       allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG));
-       allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG));
+       allowed_options.insert("speedtests", ValueSpec(VALUETYPE_FLAG,
+                       "Run speed tests"));
+       allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG,
+                       "Print debug information to console"));
 
        Settings cmd_args;
        
index 3ef1d9479a75788ac70c6a6753322b4eb59d1633..7a05bb964b62b5a05bf9081230446d824c5cd06d 100644 (file)
@@ -203,14 +203,20 @@ int main(int argc, char *argv[])
        
        // List all allowed options
        core::map<std::string, ValueSpec> allowed_options;
-       allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG));
+       allowed_options.insert("help", ValueSpec(VALUETYPE_FLAG,
+                       "Show allowed options"));
        allowed_options.insert("config", ValueSpec(VALUETYPE_STRING,
                        "Load configuration from specified file"));
-       allowed_options.insert("port", ValueSpec(VALUETYPE_STRING));
-       allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG));
-       allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG));
-       allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING));
-       allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG));
+       allowed_options.insert("port", ValueSpec(VALUETYPE_STRING,
+                       "Set network port (UDP) to use"));
+       allowed_options.insert("disable-unittests", ValueSpec(VALUETYPE_FLAG,
+                       "Disable unit tests"));
+       allowed_options.insert("enable-unittests", ValueSpec(VALUETYPE_FLAG,
+                       "Enable unit tests"));
+       allowed_options.insert("map-dir", ValueSpec(VALUETYPE_STRING,
+                       "Map directory (where everything in the world is stored)"));
+       allowed_options.insert("info-on-stderr", ValueSpec(VALUETYPE_FLAG,
+                       "Print debug information to console"));
 
        Settings cmd_args;