aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/software_spec.rb
diff options
context:
space:
mode:
authorJack Nagel2014-08-07 10:45:32 -0500
committerJack Nagel2014-08-07 10:45:32 -0500
commitd86f5f717001ca5d1340168b44df6102e74a45c1 (patch)
treebcb340fe68e1ca3e92a4619255a501a0420ae712 /Library/Homebrew/software_spec.rb
parenta68804192aff87c130df0820592f7b393193bd6c (diff)
downloadhomebrew-d86f5f717001ca5d1340168b44df6102e74a45c1.tar.bz2
Move management of options collection to the spec object
Diffstat (limited to 'Library/Homebrew/software_spec.rb')
-rw-r--r--Library/Homebrew/software_spec.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/Library/Homebrew/software_spec.rb b/Library/Homebrew/software_spec.rb
index fe0277adb..390f31e17 100644
--- a/Library/Homebrew/software_spec.rb
+++ b/Library/Homebrew/software_spec.rb
@@ -80,7 +80,15 @@ class SoftwareSpec
name = name.to_s if Symbol === name
raise ArgumentError, "option name is required" if name.empty?
raise ArgumentError, "options should not start with dashes" if name.start_with?("-")
- build.add(name, description)
+
+ description ||= case name
+ when "universal" then "Build a universal binary"
+ when "32-bit" then "Build 32-bit only"
+ when "c++11" then "Build using C++11 mode"
+ else ""
+ end
+
+ options << Option.new(name, description)
end
def depends_on spec
@@ -115,6 +123,10 @@ class SoftwareSpec
options << Option.new("without-#{name}", "Build without #{name} support")
end
end
+
+ def add_legacy_options(list)
+ list.each { |opt, desc| options << Option.new(opt[/^--(.+)$/, 1], desc) }
+ end
end
class HeadSoftwareSpec < SoftwareSpec