From 8b1b3d2a975d50fe57c2143cee79e09c0bc48609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Arild=20M=C3=A6land?= Date: Thu, 3 Sep 2009 17:10:35 +0200 Subject: [PATCH] Sort the output from `brew install` --- Library/Homebrew/ARGV+yeast.rb | 3 +++ bin/brew | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/ARGV+yeast.rb b/Library/Homebrew/ARGV+yeast.rb index 967274c317..a37e1dc1b2 100644 --- a/Library/Homebrew/ARGV+yeast.rb +++ b/Library/Homebrew/ARGV+yeast.rb @@ -64,6 +64,9 @@ module HomebrewArgvExtension def debug? flag? '--debug' or ENV['HOMEBREW_DEBUG'] end + def quieter? + flag? '--quieter' + end def flag? flag options.each do |arg| diff --git a/bin/brew b/bin/brew index b8e726c603..de7af280ab 100755 --- a/bin/brew +++ b/bin/brew @@ -1,4 +1,5 @@ #!/usr/bin/ruby +# -*- coding: utf-8 -*- $:.unshift ENV['RUBYLIB']=File.expand_path(__FILE__+'/../../Library/Homebrew') require 'pathname+yeast' require 'ARGV+yeast' @@ -70,8 +71,10 @@ begin if ARGV.named_empty? # TODO I tried to columnise it using the 'column' utility but it uses # tabs rather than spaces and the output looked wrong - puts "Available formulae:" - (HOMEBREW_PREFIX+'Library'+'Formula').children.each {|f| puts f.basename('.rb') } + puts "You must specify a formula. The following are available:" unless ARGV.quieter? + (HOMEBREW_PREFIX+'Library'+'Formula').children.sort.each do |f| + puts f.basename('.rb') + end exit 0 end