summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Roberts <Markus@reality.com>2009-08-21 17:46:57 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-08-22 14:31:07 +1000
commit47dee83464cd2ba95c931e1e4f7d2a018225c351 (patch)
tree8c0242dbac6c787f9298cc0d9faf6f40ca2229da
parenta4f68969c04bc19b3382a9d068dee6721caec1c7 (diff)
downloadpuppet-47dee83464cd2ba95c931e1e4f7d2a018225c351.tar.gz
puppet-47dee83464cd2ba95c931e1e4f7d2a018225c351.tar.xz
puppet-47dee83464cd2ba95c931e1e4f7d2a018225c351.zip
Ticket 2559 -- parseonly ignored specified file
In the command-line option parsing refactor from 0.24.x the manifest specification was lost for --parseonly, so site.pp was always used. This patch adds the parsing back in. Signed-off-by: Markus Roberts <Markus@reality.com>
-rw-r--r--lib/puppet/application/puppet.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/puppet/application/puppet.rb b/lib/puppet/application/puppet.rb
index dd752846c..a87ae488f 100644
--- a/lib/puppet/application/puppet.rb
+++ b/lib/puppet/application/puppet.rb
@@ -64,6 +64,12 @@ Puppet::Application.new(:puppet) do
end
command(:parseonly) do
+ # Set our code or file to use.
+ if options[:code] or ARGV.length == 0
+ Puppet[:code] = options[:code] || STDIN.read
+ else
+ Puppet[:manifest] = ARGV.shift
+ end
begin
Puppet::Parser::Interpreter.new.parser(Puppet[:environment])
rescue => detail