aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-08-08 14:05:09 +0100
committerMax Howell2009-08-10 18:11:23 +0100
commit7c0bd6fcb0439e939ff23691e29945b4155fd86d (patch)
tree7855c87c2990faf52358ea886d9da53016f86064 /Library
parent050d753b1f89b932e5851ba9e497575b52d434df (diff)
downloadhomebrew-7c0bd6fcb0439e939ff23691e29945b4155fd86d.tar.bz2
ohai takes multiple parameters
Will not show any of the block if the 1st additional parameter is nil
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/utils.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index bb64c3851..7c86faf1b 100644
--- a/Library/Homebrew/utils.rb
+++ b/Library/Homebrew/utils.rb
@@ -15,9 +15,15 @@
# You should have received a copy of the GNU General Public License
# along with Homebrew. If not, see <http://www.gnu.org/licenses/>.
-def ohai title
+# args are additional inputs to puts until a nil arg is encountered
+def ohai title, *args
+ return if args.length > 0 and args[0].nil?
n=`tput cols`.strip.to_i-4
puts "\033[0;34m==>\033[0;0;1m #{title[0,n]}\033[0;0m"
+ args.each do |arg|
+ return if arg.nil?
+ puts arg
+ end
end
# shows a warning in delicious pink