# HG changeset patch # User Kim Alvefur # Date 1505747311 -7200 # Node ID 259e0010a6d4806c49c35d45c5c1347c283290a0 # Parent 2c386ee5cd5c196752ddea2661888ccaddcb5f26 prosodyctl: Only demand a hostname argument to cert commands other than import diff -r 2c386ee5cd5c -r 259e0010a6d4 prosodyctl --- a/prosodyctl Mon Sep 18 17:06:35 2017 +0200 +++ b/prosodyctl Mon Sep 18 17:08:31 2017 +0200 @@ -939,13 +939,15 @@ end local subcmd = table.remove(arg, 1); if type(cert_commands[subcmd]) == "function" then - if not arg[1] then - show_message"You need to supply at least one hostname" - arg = { "--help" }; - end - if arg[1] ~= "--help" and not hosts[arg[1]] then - show_message(error_messages["no-such-host"]); - return 1; + if subcmd ~= "import" then -- hostnames are optional for import + if not arg[1] then + show_message"You need to supply at least one hostname" + arg = { "--help" }; + end + if arg[1] ~= "--help" and not hosts[arg[1]] then + show_message(error_messages["no-such-host"]); + return 1; + end end return cert_commands[subcmd](arg); elseif subcmd == "check" then