From 98cf1714c70ac6833551bfdc26a50986c1e34944 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 26 Jun 2015 16:12:17 -0700 Subject: `leap ls --print` should return values, not formulas --- lib/leap_cli/commands/list.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'lib/leap_cli/commands') diff --git a/lib/leap_cli/commands/list.rb b/lib/leap_cli/commands/list.rb index 0b78a2d..c562b59 100644 --- a/lib/leap_cli/commands/list.rb +++ b/lib/leap_cli/commands/list.rb @@ -46,12 +46,15 @@ module LeapCli; module Commands max_width = nodes.keys.inject(0) {|max,i| [i.size,max].max} nodes.each_node do |node| value = properties.collect{|prop| - if node[prop].nil? + prop_value = node[prop] + if prop_value.nil? "null" - elsif node[prop] == "" + elsif prop_value == "" "empty" + elsif prop_value.is_a? LeapCli::Config::Object + node[prop].dump_json(:compact) # TODO: add option of getting pre-evaluation values. else - node[prop] + prop_value.to_s end }.join(', ') printf("%#{max_width}s %s\n", node.name, value) -- cgit v1.2.3