lib/chef/fork/commands.rb in chef-fork-0.1.2 vs lib/chef/fork/commands.rb in chef-fork-0.1.3

- old
+ new

@@ -11,11 +11,11 @@ @application = application define_options end def run(args=[]) - rest = @application.optparse.order(args) + order_args(args=[]) end private def define_options() command_name = self.class.to_s.split("::").last.scan(/[A-Z][0-9_a-z]*/).join("-").downcase @@ -26,9 +26,21 @@ @application.options end def optparse() @application.optparse + end + + def order_args(args=[]) + args = @application.optparse.order(args) + @application.configure(@application.options) + args + end + + def parse_args(args=[]) + args = @application.optparse.parse(args) + @application.configure(@application.options) + args end def rest() @rest ||= Chef::REST.new(Chef::Config[:chef_server_url]) end