lib/inspec/shell.rb in inspec-4.16.0 vs lib/inspec/shell.rb in inspec-4.17.7

- old
+ new

@@ -110,10 +110,11 @@ file('/proc/cpuinfo').content => "value" #{print_target_info} EOF elsif topic == "resources" + require "inspec/resources" resources.sort.each do |resource| puts " - #{resource}" end elsif topic == "matchers" print_matchers_help @@ -132,10 +133,16 @@ info += "#{mark "Web Reference:"}\n\n" info += "https://www.inspec.io/docs/reference/resources/#{topic}\n\n" puts info else - puts "The resource #{topic} does not exist. For a list of valid resources, type: help resources" + begin + require "inspec/resources/#{topic}" + help topic + rescue LoadError + # TODO: stderr! + puts "The resource #{topic} does not exist. For a list of valid resources, type: help resources" + end end end def resources Inspec::Resource.registry.keys