Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #440 from rlouapre/issue-437
Browse files Browse the repository at this point in the history
Fix #437
  • Loading branch information
dmcassel committed May 17, 2015
2 parents 34d11bd + c8fa588 commit cdab18a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
3 changes: 2 additions & 1 deletion deploy/lib/Help.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ def self.info
Usage: ml {env} info [options]
General options:
-v, [--verbose] # Verbose output
--format # Output format can be (json | xml).
-v, [--verbose] # Verbose output
Displays the properties for the given environment
DOC
Expand Down
25 changes: 21 additions & 4 deletions deploy/lib/server_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,27 @@ def get_properties
end

def info
logger.info "IS_JAR: #{@@is_jar}"
logger.info "Properties:"
@properties.sort {|x,y| y <=> x}.each do |k, v|
logger.info k + ": " + v
format = find_arg(['--format'])
info = {}
info["isJar"] = @@is_jar
info["properties"] = @properties
if format == "json"
logger.info "#{JSON.pretty_generate(info)}"
elsif format == "xml"
logger.info "<info>"
logger.info "\s\s<isJar>#{@@is_jar}</isJar>"
logger.info "\s\s<properties>"
@properties.sort {|x,y| y <=> x}.each do |k, v|
logger.info "\s\s\s\s<property name=\"#{k}\">#{v}</property>"
end
logger.info "\s\s</properties>"
logger.info "</info>"
else
logger.info "IS_JAR: #{@@is_jar}"
logger.info "Properties:"
@properties.sort {|x,y| y <=> x}.each do |k, v|
logger.info k + ": " + v
end
end
return true
end
Expand Down

0 comments on commit cdab18a

Please sign in to comment.