# HG changeset patch # User Kim Alvefur # Date 1592415399 -7200 # Node ID d86f59c31458b6fbaa306518f1468a1726c5501b # Parent d770435f0f84b1bced33c839bbda6c9cc4eaf4b0 util.prosodyctl.shell: Handle argument parsing errors While almost identical to the handling in util.startup, this seems more appropriate. It would also simplify if shell-specific options need to be handled in the future. diff -r d770435f0f84 -r d86f59c31458 util/prosodyctl/shell.lua --- a/util/prosodyctl/shell.lua Wed Jun 17 19:32:12 2020 +0200 +++ b/util/prosodyctl/shell.lua Wed Jun 17 19:36:39 2020 +0200 @@ -62,6 +62,15 @@ local client = adminstream.client(); local opts = parse_args(arg); + if not opts then + if err == "param-not-found" then + print("Unknown command-line option: "..tostring(where)); + elseif err == "missing-value" then + print("Expected a value to follow command-line option: "..where); + end + os.exit(1); + end + client.events.add_handler("connected", function () if not arg.quiet then printbanner();