From d2b632dffc33d9cef077c12e4631c8e3d0ce869e Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 8 Jan 2025 20:35:05 +0000 Subject: prosodyctl: 'about' becomes 'version -v', 'version' prints only version The 'about' command remains for backwards compatibility, but hidden. --- prosodyctl | 17 +++++++++++++++-- 1 file 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", }; -- cgit v1.2.3