aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/options.rb
diff options
context:
space:
mode:
authorMike McQuaid2014-10-16 12:58:34 +0100
committerMike McQuaid2014-10-19 13:58:52 +0100
commit2db08f52e4c71d01e5596e56ac4d19414a7cde3d (patch)
tree889a93b7d7434c25f097b6f95d749ba91b2da294 /Library/Homebrew/options.rb
parentb5a2d1ade4ae9a23c8458c30b5b3b689bc3a5785 (diff)
downloadhomebrew-2db08f52e4c71d01e5596e56ac4d19414a7cde3d.tar.bz2
Add DeprecatedOption class.
Used to capture options that are being renamed.
Diffstat (limited to 'Library/Homebrew/options.rb')
-rw-r--r--Library/Homebrew/options.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb
index 65be6e1f4..edeb5d870 100644
--- a/Library/Homebrew/options.rb
+++ b/Library/Homebrew/options.rb
@@ -32,6 +32,23 @@ class Option
end
end
+class DeprecatedOption
+ attr_reader :old, :current
+
+ def initialize(old, current)
+ @old = old
+ @current = current
+ end
+
+ def old_flag
+ "--#{old}"
+ end
+
+ def current_flag
+ "--#{current}"
+ end
+end
+
class Options
include Enumerable