# HG changeset patch
# User Kim Alvefur <zash@zash.se>
# Date 1399011716 -7200
# Node ID cf0f7caa885eeedd40c2ebd8e11e8937c850ed82
# Parent  4ee14b7ef2cc530b59e81d8b52f349bdeeede53d
prosodyctl: Check for deprecated config options

diff -r 4ee14b7ef2cc -r cf0f7caa885e prosodyctl
--- a/prosodyctl	Fri May 02 08:16:26 2014 +0200
+++ b/prosodyctl	Fri May 02 08:21:56 2014 +0200
@@ -816,6 +816,9 @@
 	end
 	if not what or what == "config" then
 		print("Checking config...");
+		local deprecated = set.new({
+			"bosh_ports", "disallow_s2s", "no_daemonize", "anonymous_login",
+		});
 		local known_global_options = set.new({
 			"pidfile", "log", "plugin_paths", "prosody_user", "prosody_group", "daemonize",
 			"umask", "prosodyctl_timeout", "use_ipv6", "use_libevent", "network_settings"
@@ -830,6 +833,13 @@
 		end
 		-- Check for global options under hosts
 		local global_options = set.new(it.to_array(it.keys(config["*"])));
+		local deprecated_global_options = set.intersection(global_options, deprecated);
+		if not deprecated_global_options:empty() then
+			print("");
+			print("    You have some deprecated options in the global section:");
+			print("    "..tostring(deprecated_global_options))
+			ok = false;
+		end
 		for host, options in enabled_hosts() do
 			local host_options = set.new(it.to_array(it.keys(options)));
 			local misplaced_options = set.intersection(host_options, known_global_options);