Changeset

13609:c0b6b6a12228

prosodyctl: 'about' becomes 'version -v', 'version' prints only version The 'about' command remains for backwards compatibility, but hidden.
author Matthew Wild <mwild1@gmail.com>
date Wed, 08 Jan 2025 20:35:05 +0000
parents 13608:df32fff0963d
children 13610:ff0f4d1f16c8
files prosodyctl
diffstat 1 files changed, 15 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/prosodyctl	Wed Jan 08 08:54:52 2025 +0100
+++ b/prosodyctl	Wed Jan 08 20:35:05 2025 +0000
@@ -473,6 +473,19 @@
 	print("");
 end
 
+function commands.version(arg)
+	local flags = { short_params = { h = "help"; ["?"] = "help", v = "verbose" } };
+	local opts = parse_args(arg, flags);
+	if opts.help then
+		show_usage("version [-v]", [[Show current Prosody version, or more]]);
+		return 0;
+	elseif opts.verbose then
+		return commands.about(arg);
+	end
+
+	print("Prosody "..(prosody.version or "(unknown version)"));
+end
+
 function commands.reload(arg)
 	local opts = parse_args(arg, only_help);
 	if opts.help then
@@ -618,7 +631,7 @@
 
 	if not commands[command] then -- Show help for all commands
 		function show_usage(usage, desc)
-			print(string.format(" %-11s    %s", usage, desc));
+			print(string.format(" %-14s    %s", usage, desc));
 		end
 
 		print("prosodyctl - Manage a Prosody server");
@@ -637,8 +650,8 @@
 			"Plugin management:",
 				"install"; "remove"; "list";
 			"Informative:",
-				"about",
 				"check",
+				"version",
 			"Other:",
 				"cert",
 		};