prosodyctl
changeset 11586 a3d48204ec95
parent 11567 0983653cbfdf
child 11591 ce7c52a6d650
--- 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