Add sample external commands: dirty, leaves, options

See:

* http://github.com/mxcl/homebrew/issues/issue/1359
* http://github.com/mxcl/homebrew/issues/issue/1438
This commit is contained in:
Adam Vandenberg 2010-06-03 15:09:20 -07:00
parent b016c2eae5
commit 89717c9d90
3 changed files with 25 additions and 0 deletions

View File

@ -0,0 +1,7 @@
# See: http://github.com/mxcl/homebrew/issues/issue/1359
to_list = HOMEBREW_CELLAR.children.select { |pn| pn.directory? }
to_list.each do |d|
versions = d.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s }
puts "#{d.basename} (#{versions.join(', ')})" if versions.size > 1
end

View File

@ -0,0 +1,9 @@
# See: http://github.com/mxcl/homebrew/issues/issue/1438
require 'formula'
deps_graph = Formula.get_used_by
formulas = HOMEBREW_CELLAR.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s }
formulas.each do |name|
deps = deps_graph[name] || []
puts name if !deps.any? { |dep| formulas.include?(dep) }
end

View File

@ -0,0 +1,9 @@
ARGV.formulae.each do |f|
f.options rescue next
puts f.name
f.options.each do |o|
puts o[0]
puts "\t"+o[1]
end
puts
end