diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 01:24:55 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-02-15 01:24:55 +0000 |
commit | 88a3343ed57c01ca358da8473d15fc4d2b4a5bff (patch) | |
tree | 3fe773bb113480f68eaea508d241cbaf90eebfde /railties/lib/rails_generator/options.rb | |
parent | 60f7a5cab73fab032fdb73d1a9a8061cf20031d2 (diff) | |
download | rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.gz rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.tar.bz2 rails-88a3343ed57c01ca358da8473d15fc4d2b4a5bff.zip |
Backed out of routing merge.. investigating missing patches
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'railties/lib/rails_generator/options.rb')
-rw-r--r-- | railties/lib/rails_generator/options.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/railties/lib/rails_generator/options.rb b/railties/lib/rails_generator/options.rb index 54785413ef..afe2d31625 100644 --- a/railties/lib/rails_generator/options.rb +++ b/railties/lib/rails_generator/options.rb @@ -1,12 +1,8 @@ require 'optparse' -require File.dirname(__FILE__) + '/support/class_inheritable_attributes' +require File.dirname(__FILE__) + '/../support/class_inheritable_attributes' module Rails module Generator - # Implement add_options! to add your options to the parser: - # def add_options!(opt) - # opt.on('-v', '--verbose') { |value| options[:verbose] = value } - # end module Options def self.append_features(base) super @@ -89,14 +85,13 @@ module Rails @option_parser = OptionParser.new do |opt| opt.banner = banner - add_options!(opt) if respond_to?(:add_options!) + add_options!(opt) add_general_options!(opt) opt.parse!(args) end - return args - ensure self.options = full_options(runtime_options) + args end # Raise a usage error. Override usage_message to provide a blurb @@ -114,6 +109,14 @@ module Rails "Usage: #{$0} [options]" end + # Override with a method that adds options to the parser. + # Added options should use the options hash. For example, + # def add_options!(opt) + # opt.on('-v', '--verbose') { |value| options[:verbose] = value } + # end + def add_options!(opt) + end + # Adds general options like -h and --quiet. Usually don't override. def add_general_options!(opt) opt.separator '' |