summary refs log tree commit diff stats
path: root/plugins
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-04-05 13:01:15 -0400
committerPatrick Griffis <tingping@tingping.se>2016-04-07 18:27:39 -0700
commit0694cb9045ed07f08a625f07051604fce2945b9d (patch)
treea08523b06de8f271d171b40132f72e92c0bc17cc /plugins
parent8099f23bdff791136d63332d34bb0415e1c02a6b (diff)
lua: More consistency with Python plugin
Diffstat (limited to 'plugins')
-rw-r--r--plugins/lua/lua.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/plugins/lua/lua.c b/plugins/lua/lua.c
index bbedf5d1..bb346426 100644
--- a/plugins/lua/lua.c
+++ b/plugins/lua/lua.c
@@ -35,9 +35,9 @@
 
 #include <hexchat-plugin.h>
 
-static char plugin_name[] = "lua";
+static char plugin_name[] = "Lua";
 static char plugin_description[] = "Lua scripting interface";
-static char plugin_version[256] = "1.3-";
+static char plugin_version[16] = "1.3";
 
 static char console_tab[] = ">>lua<<";
 static char command_help[] =
@@ -1628,13 +1628,19 @@ static int command_lua(char *word[], char *word_eol[], void *userdata)
 	else if(!strcmp(word[2], "list"))
 	{
 		guint i;
+		hexchat_print(ph,
+		   "Name             Version  Filename             Description\n"
+		   "----             -------  --------             -----------\n");
 		for(i = 0; i < scripts->len; i++)
 		{
 			script_info *info = scripts->pdata[i];
-			hexchat_printf(ph, "%s %s: %s (%s)", info->name, info->version, info->description, info->filename);
+			char *basename = g_path_get_basename(info->filename);
+			hexchat_printf(ph, "%-16s %-8s %-20s %-10s\n", info->name, info->version,
+						   basename, info->description);
+			g_free(basename);
 		}
 		if(interp)
-			hexchat_printf(ph, "%s %s", interp->name, plugin_version);
+			hexchat_printf(ph, "%-16s %-8s", interp->name, plugin_version);
 	}
 	else if(!strcmp(word[2], "console"))
 	{
@@ -1649,7 +1655,11 @@ static int command_lua(char *word[], char *word_eol[], void *userdata)
 
 G_MODULE_EXPORT int hexchat_plugin_init(hexchat_plugin *plugin_handle, char **name, char **description, char **version, char *arg)
 {
-	strcat(plugin_version, strchr(LUA_VERSION, ' ') + 1);
+	if (g_str_has_prefix(LUA_VERSION, "Lua "))
+	{
+		strcat(plugin_version, "/");
+		g_strlcat(plugin_version, LUA_VERSION + 4, sizeof(plugin_version));
+	}
 
 	*name = plugin_name;
 	*description = plugin_description;