aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2025-01-08 20:35:05 +0000
committerMatthew Wild <mwild1@gmail.com>2025-01-08 20:35:05 +0000
commitd2b632dffc33d9cef077c12e4631c8e3d0ce869e (patch)
tree249f42c5be24dad7c340875180b83bf8c832623e
parentf9731db67b3a0011ee62042e86e526f9b1873615 (diff)
downloadprosody-d2b632dffc33d9cef077c12e4631c8e3d0ce869e.tar.gz
prosody-d2b632dffc33d9cef077c12e4631c8e3d0ce869e.zip
prosodyctl: 'about' becomes 'version -v', 'version' prints only version
The 'about' command remains for backwards compatibility, but hidden.
-rwxr-xr-xprosodyctl17
1 files changed, 15 insertions, 2 deletions
diff --git a/prosodyctl b/prosodyctl
index c891e1b5..6e19170d 100755
--- a/prosodyctl
+++ b/prosodyctl
@@ -473,6 +473,19 @@ function commands.about(arg)
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 @@ local command_runner = async.runner(function ()
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 @@ local command_runner = async.runner(function ()
"Plugin management:",
"install"; "remove"; "list";
"Informative:",
- "about",
"check",
+ "version",
"Other:",
"cert",
};