Issue #5011 has been updated by mame (Yusuke Endoh). Received. Your proposal is interesting, but slightly vague. I understand motivation, but not the detailed behavior. If you tolerate the details, I guess you can do it with gem, without modifying ruby interpreter. [load_main.rb] at_exit do if respond_to?(:main, true) && method(:main).source_location[0] == $0 options = {} # parse command line options... main(ARGF, **options) end end [bar.rb] def main(input) p :bar end [foo1.rb] require "bar" def main(input, opt) p :foo1 end [foo2.rb] require "bar" $ ruby -rload_main foo1.rb :foo $ ruby -rload_main foo2.rb -- Yusuke Endoh <mame / tsg.ne.jp> ---------------------------------------- Feature #5011: Add Perl 6-like main method definition support: accept command-line arguments as method arguments https://bugs.ruby-lang.org/issues/5011#change-27082 Author: rosenfeld (Rodrigo Rosenfeld Rosas) Status: Assigned Priority: Low Assignee: matz (Yukihiro Matsumoto) Category: Target version: Take a look at this: http://perlgeek.de/en/article/5-to-6#post_14 I'm not really sure how this would look like in Ruby, but I like the idea of defining a main method could extract their params from command-line params. This would also be an alternative for issue #4824: http://redmine.ruby-lang.org/projects/ruby-19/issues/4824 -- http://bugs.ruby-lang.org/