Method: Inspec::BaseCLI.exec_options

Defined in:
lib/inspec/base_cli.rb

.exec_optionsObject



134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/inspec/base_cli.rb', line 134

def self.exec_options
  target_options
  profile_options
  option :controls, type: :array,
    desc: "A list of control names to run, or a list of /regexes/ to match against control names. Ignore all other tests."
  option :reporter, type: :array,
    banner: "one two:/output/file/path",
    desc: "Enable one or more output reporters: cli, documentation, html, progress, json, json-min, json-rspec, junit, yaml"
  option :reporter_message_truncation, type: :string,
    desc: "Number of characters to truncate failure messages and code_desc in report data to (default: no truncation)"
  option :reporter_backtrace_inclusion, type: :boolean,
    desc: "Include a code backtrace in report data (default: true)"
  option :input, type: :array, banner: "name1=value1 name2=value2",
    desc: "Specify one or more inputs directly on the command line, as --input NAME=VALUE. Accepts single-quoted YAML and JSON structures."
  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,
    desc: "Write out a lockfile based on this execution (unless one already exists)"
  option :backend_cache, type: :boolean,
    desc: "Allow caching for backend command output. (default: true)"
  option :show_progress, type: :boolean,
    desc: "Show progress while executing tests."
  option :distinct_exit, type: :boolean, default: true,
    desc: "Exit with code 101 if any tests fail, and 100 if any are skipped (default).  If disabled, exit 0 on skips and 1 for failures."
  option :silence_deprecations, type: :array,
    banner: "[all]|[GROUP GROUP...]",
    desc: "Suppress deprecation warnings. See install_dir/etc/deprecations.json for list of GROUPs or use 'all'."
  option :diff, type: :boolean, default: true,
    desc: "Use --no-diff to suppress 'diff' output of failed textual test results."
  option :sort_results_by, type: :string, default: "file", banner: "--sort-results-by=none|control|file|random",
    desc: "After normal execution order, results are sorted by control ID, or by file (default), or randomly. None uses legacy unsorted mode."
  option :filter_empty_profiles, type: :boolean, default: false,
    desc: "Filter empty profiles (profiles without controls) from the report."
  option :command_timeout, type: :numeric,
    desc: "Maximum seconds to allow commands to run during execution.",
    long_desc: "Maximum seconds to allow commands to run during execution. A timed out command is considered an error."
  option :reporter_include_source, type: :boolean, default: false,
    desc: "Include full source code of controls in the CLI report"
end