aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/options.rb
diff options
context:
space:
mode:
authorBaptiste Fontaine2015-12-27 19:12:27 +0100
committerBaptiste Fontaine2015-12-27 22:16:46 +0100
commitb7e98b129cc19d0d4ce283a358785665ac100212 (patch)
treecf02380494a7da080a02a03655a92cbf300fc6b6 /Library/Homebrew/options.rb
parente224c2fc9eb136b43be9a46f74061dc8a37feb71 (diff)
downloadbrew-b7e98b129cc19d0d4ce283a358785665ac100212.tar.bz2
cmd/options.rb: move common code in options.rb
Closes Homebrew/homebrew#47423. Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
Diffstat (limited to 'Library/Homebrew/options.rb')
-rw-r--r--Library/Homebrew/options.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb
index ba10dca8b..1d92fbf47 100644
--- a/Library/Homebrew/options.rb
+++ b/Library/Homebrew/options.rb
@@ -112,3 +112,13 @@ class Options
"#<#{self.class.name}: #{to_a.inspect}>"
end
end
+
+module Homebrew
+ def dump_options_for_formula(f)
+ f.options.sort_by(&:flag).each do |opt|
+ puts "#{opt.flag}\n\t#{opt.description}"
+ end
+ puts "--devel\n\tInstall development version #{f.devel.version}" if f.devel
+ puts "--HEAD\n\tInstall HEAD version" if f.head
+ end
+end