Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Commit

Permalink
brew -c1 one line configuration summary
Browse files Browse the repository at this point in the history
At your option: `brew --config -1`.
  • Loading branch information
mxcl committed Aug 31, 2012
1 parent 8f95b3f commit a8fadbf
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
24 changes: 23 additions & 1 deletion Library/Homebrew/cmd/--config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

module Homebrew extend self
def __config
puts config_s
if ARGV.first == '-1'
dump_c1
else
puts config_s
end
end

def llvm
Expand Down Expand Up @@ -134,4 +138,22 @@ def config_s
Which Ruby: #{describe_ruby}
EOS
end

def dump_c1
stuff = []
print "#{HOMEBREW_PREFIX}-#{HOMEBREW_VERSION} "
print MACOS_FULL_VERSION
print "-#{kernel}" if MacOS.version < :lion
print ' '
if MacOS::Xcode.version > "4.3"
print MacOS::Xcode.prefix unless MacOS::Xcode.prefix.to_s =~ %r{^/Applications/Xcode.app}
else
print MacOS::Xcode.prefix unless MacOS::Xcode.prefix.to_s =~ %r{^/Developer}
end
print "#{MacOS::Xcode.version}"
print "-noclt" unless MacOS::CLT.installed?
print " clang-#{clang_build} llvm-#{llvm} "
print "#{MacOS::XQuartz.prefix}-#{MacOS::XQuartz.version}" if MacOS::XQuartz.prefix
puts
end
end
5 changes: 5 additions & 0 deletions bin/brew
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ begin
cmd = ARGV.shift
cmd = aliases[cmd] if aliases[cmd]

if cmd == '-c1'
cmd = '--config'
ARGV.unshift('-1')
end

# Add example external commands to PATH before checking.
ENV['PATH'] += ":#{HOMEBREW_REPOSITORY}/Library/Contributions/cmds"
if which "brew-#{cmd}"
Expand Down

0 comments on commit a8fadbf

Please sign in to comment.