]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/debug.qh
Automatically get the command name in the "Incorrect parameters ..." messages
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / debug.qh
index a12d9ffc216f6586bd166175136602778c8e4ffc..49b6a5787a2ddd0e1301448b78b2062523bd10bf 100644 (file)
@@ -187,7 +187,7 @@ bool autocvar_debugdraw;
                        default:
                        case CMD_REQUEST_USAGE:
                        {
-                               LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv");
+                               LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " debugdraw_sv");
                                return;
                        }
                }
@@ -211,7 +211,7 @@ GENERIC_COMMAND(bufstr_get, "Examine a string buffer object", false)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index");
+                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " bufstr_get bufhandle string_index");
                        return;
                }
        }
@@ -224,13 +224,13 @@ GENERIC_COMMAND(version, "Print the current version", false)
        {
                case CMD_REQUEST_COMMAND:
                {
-                       LOG_INFO(WATERMARK);
+                       LOG_INFO(PROGNAME, " version: ", WATERMARK);
                        return;
                }
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " version");
+                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " version");
                        return;
                }
        }
@@ -266,7 +266,7 @@ GENERIC_COMMAND(cvar_localchanges, "Print locally changed cvars", false)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("Usage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges");
+                       LOG_HELP("Usage:^3 ", GetProgramCommandPrefix(), " cvar_localchanges");
                        return;
                }
        }
@@ -353,13 +353,11 @@ GENERIC_COMMAND(find, "Search through entities for matching classname", false)
                }
 
                default:
-               {
-                       LOG_INFO("Incorrect parameters for ^2find^7");
-        }
+                       LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " find classname");
-                       LOG_INFO("  Where 'classname' is the classname to search for.");
+                       LOG_HELP("Usage:^3 " GetProgramCommandPrefix() " find classname");
+                       LOG_HELP("  Where 'classname' is the classname to search for.");
                        return;
                }
        }
@@ -378,10 +376,10 @@ GENERIC_COMMAND(findat, "Search through entities for matching origin", false)
                }
 
                default:
-                       LOG_INFO("Incorrect parameters for ^2findat^7");
+                       LOG_INFOF("Incorrect parameters for ^2%s^7", argv(0));
                case CMD_REQUEST_USAGE:
                {
-                       LOG_INFO("Usage:^3 " GetProgramCommandPrefix() " findat \"0 0 0\"");
+                       LOG_HELP("Usage:^3 " GetProgramCommandPrefix() " findat \"x y z\"");
                        return;
                }
        }