Permalink
Browse files

Prune some unused code from brew

  • Loading branch information...
Sharpie committed Jan 25, 2012
1 parent 0f59d99 commit 60c33d3732c1c27e496d2b29f8c54246017484ad
Showing with 4 additions and 29 deletions.
  1. +4 −29 bin/brew
View
@@ -5,14 +5,11 @@ HOMEBREW_BREW_FILE = ENV['HOMEBREW_BREW_FILE'] = File.expand_path(__FILE__)
require 'pathname'
HOMEBREW_LIBRARY_PATH = Pathname.new(__FILE__).realpath.dirname.parent.join("Library/Homebrew").to_s
-$:.unshift(HOMEBREW_LIBRARY_PATH + '/vendor')
$:.unshift(HOMEBREW_LIBRARY_PATH)
require 'global'
-case ARGV.first when '-h', '--help', '--usage', '-?', 'help', nil
- require 'cmd/help'
- puts Homebrew.help_s
- exit ARGV.first ? 0 : 1
+case ARGV.first when nil
+ abort "Nothing to do."
when '--version'
puts HOMEBREW_VERSION
exit 0
@@ -46,34 +43,12 @@ rescue LoadError => e
end
begin
- aliases = {'ls' => :list,
- 'homepage' => :home,
- '-S' => :search,
- 'up' => :update,
- 'ln' => :link,
- 'instal' => :install, # gem does the same
- 'rm' => :uninstall,
- 'remove' => :uninstall,
- 'configure' => :diy,
- 'abv' => :info,
- 'dr' => :doctor,
- '--repo' => '--repository',
- 'environment' => '--env' # same as gem
- }
+ aliases = { 'ln' => :link }
cmd = ARGV.shift
cmd = aliases[cmd] if aliases[cmd]
- # Add example external commands to PATH before checking.
- ENV['PATH'] += ":#{HOMEBREW_REPOSITORY}/Library/Contributions/examples"
- if system "/usr/bin/which -s brew-#{cmd}"
- %w[CACHE CELLAR LIBRARY_PATH PREFIX REPOSITORY].each do |e|
- ENV["HOMEBREW_#{e}"] = Object.const_get "HOMEBREW_#{e}"
- end
- exec "brew-#{cmd}", *ARGV
- elsif require? `/usr/bin/which brew-#{cmd}.rb`
- exit 0
- elsif require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd
+ if require? HOMEBREW_REPOSITORY/"Library/Homebrew/cmd"/cmd
Homebrew.send cmd.to_s.gsub('-', '_')
else
# Check for git commands

0 comments on commit 60c33d3

Please sign in to comment.