diff --git a/lib/thor.rb b/lib/thor.rb index 1409623b3..f004981ce 100644 --- a/lib/thor.rb +++ b/lib/thor.rb @@ -339,6 +339,13 @@ def disable_required_check?(command) #:nodoc: command && disable_required_check.include?(command.name.to_sym) end + def deprecation_warning(message) #:nodoc: + unless ENV['THOR_SILENCE_DEPRECATION'] + warn "Deprecation warning: #{message}\n" + + 'You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.' + end + end + protected def stop_on_unknown_option #:nodoc: