Changeset

11582:a3d48204ec95

prosodyctl: Reorganize help / command list
author Kim Alvefur <zash@zash.se>
date Fri, 22 Jan 2021 00:11:39 +0100
parents 11581:7e111f7147dc
children 11583:4ee7a6a8753e
files prosodyctl
diffstat 1 files changed, 15 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/prosodyctl	Mon May 24 01:34:01 2021 +0200
+++ b/prosodyctl	Fri Jan 22 00:11:39 2021 +0100
@@ -643,19 +643,26 @@
 
 	if not commands[command] then -- Show help for all commands
 		function show_usage(usage, desc)
-			print(" "..usage);
-			print("    "..desc);
+			print(string.format(" %-11s    %s", usage, desc));
 		end
 
 		print("prosodyctl - Manage a Prosody server");
 		print("");
 		print("Usage: "..arg[0].." COMMAND [OPTIONS]");
 		print("");
-		print("Where COMMAND may be one of:\n");
+		print("Where COMMAND may be one of:");
 
 		local hidden_commands = require "util.set".new{ "register", "unregister" };
-		local commands_order = { "install", "remove", "list", "adduser", "passwd", "deluser", "start", "stop", "restart", "reload",
-			"about" };
+		local commands_order = {
+			"Plugin management:",
+				"install"; "remove"; "list";
+			"User management:",
+				"adduser"; "passwd"; "deluser";
+			"Process management:",
+				"start"; "stop"; "restart"; "reload"; "status";
+			"Informative:",
+				"about",
+		};
 
 		local done = {};
 
@@ -663,15 +670,16 @@
 			local command_func = commands[command_name];
 			if command_func then
 				command_func{ "--help" };
+				done[command_name] = true;
+			else
 				print""
-				done[command_name] = true;
+				print(command_name);
 			end
 		end
 
 		for command_name, command_func in pairs(commands) do
 			if not done[command_name] and not hidden_commands:contains(command_name) then
 				command_func{ "--help" };
-				print""
 				done[command_name] = true;
 			end
 		end