mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Merge pull request #4437 from inspec/zenspider/waivers/input
Rough draft on waiver input
This commit is contained in:
commit
576370cf62
3 changed files with 10 additions and 2 deletions
|
@ -137,6 +137,8 @@ module Inspec
|
|||
desc: "Specify one or more inputs directly on the command line, as --input NAME=VALUE"
|
||||
option :input_file, type: :array,
|
||||
desc: "Load one or more input files, a YAML file with values for the profile to use"
|
||||
option :waiver_file, type: :array,
|
||||
desc: "Load one or more waiver files."
|
||||
option :attrs, type: :array,
|
||||
desc: "Legacy name for --input-file - deprecated."
|
||||
option :create_lockfile, type: :boolean,
|
||||
|
|
|
@ -220,8 +220,8 @@ module Inspec
|
|||
|
||||
path = determine_cfg_path(cli_opts)
|
||||
|
||||
cfg_io = File.open(path) if path
|
||||
cfg_io || StringIO.new('{ "version": "1.1" }')
|
||||
ver = KNOWN_VERSIONS.max
|
||||
path ? File.open(path) : StringIO.new({ "version" => ver }.to_json)
|
||||
end
|
||||
|
||||
def check_for_piped_config(cli_opts)
|
||||
|
|
|
@ -56,6 +56,12 @@ module Inspec
|
|||
RunnerRspec.new(@conf)
|
||||
end
|
||||
|
||||
if @conf[:waiver_file]
|
||||
waivers = @conf.delete(:waiver_file)
|
||||
@conf[:input_file] ||= []
|
||||
@conf[:input_file].concat waivers
|
||||
end
|
||||
|
||||
# About reading inputs:
|
||||
# @conf gets passed around a lot, eventually to
|
||||
# Inspec::InputRegistry.register_external_inputs.
|
||||
|
|
Loading…
Add table
Reference in a new issue