From e650bd094292ab28810b457aec3f9a9c04a78cfc Mon Sep 17 00:00:00 2001 From: myk002 Date: Sun, 17 Jul 2022 17:05:29 -0700 Subject: [PATCH] add comment about plugin docs --- library/LuaApi.cpp | 5 ++++- library/include/PluginManager.h | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 649ceb2dc..c332933a2 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -3133,7 +3133,10 @@ static int internal_getCommandHelp(lua_State *L) { help += "."; } - help += "\n" + pc.usage; + if (pc.usage.size()) + { + help += "\n" + pc.usage; + } lua_pushstring(L, help.c_str()); return 1; } diff --git a/library/include/PluginManager.h b/library/include/PluginManager.h index f168d7e47..79b7e0492 100644 --- a/library/include/PluginManager.h +++ b/library/include/PluginManager.h @@ -97,6 +97,10 @@ namespace DFHack /// create a command with a name, description, function pointer to its code /// and saying if it needs an interactive terminal /// Most commands shouldn't require an interactive terminal! + /// Note that the description and usage fields are only used for + /// out-of-tree plugins that do not have rendered help installed in + /// the hack/docs directory. Help for all internal plugins comes from + /// the rendered .rst files. PluginCommand(const char * _name, const char * _description, command_function function_,