diff --git a/doc-src/SASS_CHANGELOG.md b/doc-src/SASS_CHANGELOG.md index 6fc9cb15..2b083612 100644 --- a/doc-src/SASS_CHANGELOG.md +++ b/doc-src/SASS_CHANGELOG.md @@ -13,6 +13,8 @@ * IronRuby compatibility. This is sort of a hack: IronRuby reports its version as 1.9, but it doesn't support the encoding APIs, so we treat it as 1.8 instead. +* The `--quiet` option now silences informational output from `--update` and `--watch`. + ## 3.0.23 [Tagged on GitHub](http://github.com/nex3/haml/commit/3.0.23). diff --git a/lib/haml/exec.rb b/lib/haml/exec.rb index 3e8e9b22..d6413a30 100644 --- a/lib/haml/exec.rb +++ b/lib/haml/exec.rb @@ -124,9 +124,18 @@ module Haml # @param color [Symbol] The name of the color to use for this action. # Can be `:red`, `:green`, or `:yellow`. def puts_action(name, color, arg) + return if @options[:for_engine][:quiet] printf color(color, "%11s %s\n"), name, arg end + # Same as \{Kernel.puts}, but doesn't print anything if the `--quiet` option is set. + # + # @param args [Array] Passed on to \{Kernel.puts} + def puts(*args) + return if @options[:for_engine][:quiet] + Kernel.puts(*args) + end + # Wraps the given string in terminal escapes # causing it to have the given color. # If terminal esapes aren't supported on this platform, @@ -300,7 +309,7 @@ END 'Output style. Can be nested (default), compact, compressed, or expanded.') do |name| @options[:for_engine][:style] = name.to_sym end - opts.on('-q', '--quiet', 'Silence warnings during compilation.') do + opts.on('-q', '--quiet', 'Silence warnings and status messages during compilation.') do @options[:for_engine][:quiet] = true end opts.on('-g', '--debug-info',