From edd9415df66174c6d880a1d606ff1bbf2a8b0c93 Mon Sep 17 00:00:00 2001 From: Kevin Zander Date: Wed, 1 Mar 2017 16:02:49 -0600 Subject: [PATCH] Add a deprecated_in variable to util.deprecate args table (#1586) --- lib/awful/util.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/awful/util.lua b/lib/awful/util.lua index ea59042f..9bccf578 100644 --- a/lib/awful/util.lua +++ b/lib/awful/util.lua @@ -40,8 +40,16 @@ local displayed_deprecations = {} -- @param[opt] see The message to a new method / function to use. -- @tparam table args Extra arguments -- @tparam boolean args.raw Print the message as-is without the automatic context +-- @tparam integer args.deprecated_in Print the message only when Awesome's +-- version is equal to or greater than deprecated_in. function util.deprecate(see, args) args = args or {} + if args.deprecated_in then + local dep_ver = "v" .. tostring(args.deprecated_in) + if awesome.version < dep_ver then + return + end + end local tb = debug.traceback() if displayed_deprecations[tb] then return