From 5683fd983b9a165ffbb8f08e67cfe903ec0e41b7 Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Fri, 30 Apr 2010 15:47:15 -0700 Subject: Feature #2276 Single Executable: Pass a commandline object to the application Refactor so that the command line options only get parsed once Signed-off-by: Jesse Wolfe --- lib/puppet/application.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/puppet/application.rb') diff --git a/lib/puppet/application.rb b/lib/puppet/application.rb index 49a146ffe..f72714b12 100644 --- a/lib/puppet/application.rb +++ b/lib/puppet/application.rb @@ -229,7 +229,7 @@ class Puppet::Application end end - attr_reader :options, :opt_parser + attr_reader :options, :opt_parser, :command_line # Every app responds to --version option("--version", "-V") do |arg| @@ -250,7 +250,8 @@ class Puppet::Application def preinit end - def initialize + def initialize(command_line = nil) + @command_line = command_line || Puppet::Util::CommandLine.new @opt_parser = self.class.new_option_parser( self ) @options = {} -- cgit