diff options
author | Matthew Wild <mwild1@gmail.com> | 2022-03-05 11:36:38 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2022-03-05 11:36:38 +0000 |
commit | 5af6db124a35868be947a91bfeb8206bd18ded6c (patch) | |
tree | 0d2cfd27459bf837e3302e988af8f70acf61beed /util | |
parent | 1af4939c118831e3020f765c91a4b6b33f55394b (diff) | |
download | prosody-5af6db124a35868be947a91bfeb8206bd18ded6c.tar.gz prosody-5af6db124a35868be947a91bfeb8206bd18ded6c.zip |
prosodyctl: check: Slightly improved argument handling
Diffstat (limited to 'util')
-rw-r--r-- | util/prosodyctl/check.lua | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/util/prosodyctl/check.lua b/util/prosodyctl/check.lua index b452a0bf..c0eeffcc 100644 --- a/util/prosodyctl/check.lua +++ b/util/prosodyctl/check.lua @@ -254,6 +254,9 @@ local check_opts = { short_params = { h = "help", v = "verbose"; }; + value_params = { + ping = true; + }; }; local function check(arg) @@ -262,7 +265,14 @@ local function check(arg) 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"; |