diff --git a/src/cli/one_helper.rb b/src/cli/one_helper.rb index 87ed26ce55..9797452543 100644 --- a/src/cli/one_helper.rb +++ b/src/cli/one_helper.rb @@ -132,6 +132,11 @@ EOT :large => '--raw string', :description => 'Raw string to add to the template. Not to be confused with the RAW attribute', :format => String + }, + { + :name => 'dry', + :large => '--dry', + :description => 'Just print the template' } ] diff --git a/src/cli/onetemplate b/src/cli/onetemplate index 462613b616..e1c6904359 100755 --- a/src/cli/onetemplate +++ b/src/cli/onetemplate @@ -121,7 +121,12 @@ cmd=CommandParser::CmdParser.new(ARGV) do template = res.last end - tmpl.allocate(template) + if options[:dry] + puts template + exit 0 + else + tmpl.allocate(template) + end rescue => e STDERR.puts e.messsage exit -1 diff --git a/src/cli/onevm b/src/cli/onevm index 9d612629d3..b5df5cd319 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -139,6 +139,11 @@ cmd=CommandParser::CmdParser.new(ARGV) do template = res.last end + + if options[:dry] + puts template + exit 0 + end rescue Exception => e STDERR.puts "Error reading template." next -1