diff options
author | Kim Alvefur <zash@zash.se> | 2017-09-18 17:08:31 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2017-09-18 17:08:31 +0200 |
commit | 188a2f9b5cdcdb3ac79cda19d84ea6735c6d27f5 (patch) | |
tree | 5ab6716fe5b4911ab8f3f5578e291f8598a00cc6 /prosodyctl | |
parent | 51cfd5b4c7b485ad72c8aa9950b3403a14f67a89 (diff) | |
download | prosody-188a2f9b5cdcdb3ac79cda19d84ea6735c6d27f5.tar.gz prosody-188a2f9b5cdcdb3ac79cda19d84ea6735c6d27f5.zip |
prosodyctl: Only demand a hostname argument to cert commands other than import
Diffstat (limited to 'prosodyctl')
-rwxr-xr-x | prosodyctl | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -939,13 +939,15 @@ function commands.cert(arg) 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 |