aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/list.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-05-27 13:59:02 -0700
committerelijah <elijah@riseup.net>2013-05-27 13:59:02 -0700
commit3a77ab2c9cc82853ef5b0add4f15227cc6d696a9 (patch)
tree2407402e0e238a3e1e2a6349767a6fa2c01857dd /lib/leap_cli/commands/list.rb
parent32e377d905462fa2c20dde9b59532297a7f3aea6 (diff)
downloadleap_cli-3a77ab2c9cc82853ef5b0add4f15227cc6d696a9.tar.gz
leap_cli-3a77ab2c9cc82853ef5b0add4f15227cc6d696a9.tar.bz2
added support for disabling nodes
Diffstat (limited to 'lib/leap_cli/commands/list.rb')
-rw-r--r--lib/leap_cli/commands/list.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/leap_cli/commands/list.rb b/lib/leap_cli/commands/list.rb
index 4ff2367..7e803d4 100644
--- a/lib/leap_cli/commands/list.rb
+++ b/lib/leap_cli/commands/list.rb
@@ -13,8 +13,12 @@ module LeapCli; module Commands
arg_name 'FILTER', :optional => true
command :list do |c|
c.flag 'print', :desc => 'What attributes to print (optional)'
+ c.switch 'disabled', :desc => 'Include disabled nodes in the list.', :negatable => false
c.action do |global_options,options,args|
puts
+ if options['disabled']
+ manager.load(:include_disabled => true) # reload, with disabled nodes
+ end
if options['print']
print_node_properties(manager.filter(args), options['print'])
else
@@ -39,9 +43,9 @@ module LeapCli; module Commands
node.evaluate
value = properties.collect{|prop|
if node[prop].nil?
- "[null]"
+ "null"
elsif node[prop] == ""
- "[empty]"
+ "empty"
else
node[prop]
end