class Inspec::Shell
def help(resource = nil)
def help(resource = nil) if resource.nil? ctx = @runner.backend puts <<EOF lable commands: `[resource]` - run resource on target machine `help resources` - show all available resources that can be used as commands `help [resource]` - information about a specific resource `exit` - exit the InSpec shell can use resources in this environment to test the target machine. For example: command('uname -a').stdout file('/proc/cpuinfo').content => "value", are currently running on: OS platform: #{mark ctx.os[:name] || 'unknown'} OS family: #{mark ctx.os[:family] || 'unknown'} OS release: #{mark ctx.os[:release] || 'unknown'} elsif resource == 'resources' resources elsif !Inspec::Resource.registry[resource].nil? puts <<EOF rk 'Name:'} #{resource} rk 'Description:'} spec::Resource.registry[resource].desc} rk 'Example:'} int_example(Inspec::Resource.registry[resource].example)} rk 'Web Reference:'} s://github.com/chef/inspec/blob/master/docs/resources.rst##{resource} else puts 'Only the following resources are available:' resources end end