# HG changeset patch # User Matthew Wild # Date 1646480198 0 # Node ID 10353ad0ca7af899771e0e54026ef09cbf88a1c5 # Parent ea5e46601cfb9dae8b1de08842ebda5da28b40f4 prosodyctl: check: Slightly improved argument handling diff -r ea5e46601cfb -r 10353ad0ca7a util/prosodyctl/check.lua --- a/util/prosodyctl/check.lua Sat Mar 05 11:31:22 2022 +0000 +++ b/util/prosodyctl/check.lua Sat Mar 05 11:36:38 2022 +0000 @@ -254,6 +254,9 @@ short_params = { h = "help", v = "verbose"; }; + value_params = { + ping = true; + }; }; local function check(arg) @@ -262,7 +265,14 @@ return 1; end local what = table.remove(arg, 1); - local opts = assert(parse_args(arg, check_opts)); + local opts, opts_err, opts_info = parse_args(arg, check_opts); + if opts_err == "missing-value" then + print("Error: Expected a value after '"..opts_info.."'"); + return 1; + elseif opts_err == "param-not-found" then + print("Error: Unknown parameter: "..opts_info); + return 1; + end local array = require "util.array"; local set = require "util.set"; local it = require "util.iterators";