Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inspec shell's commandor alias -c option does not obey stdout: false reporter option set using config file #6572

Open
Nik08 opened this issue Jul 19, 2023 · 1 comment

Comments

@Nik08
Copy link
Contributor

Nik08 commented Jul 19, 2023

Inspec shell command, alias -c option does not obey stdout: false for reporter set using config file

Describe the problem

Created test-config.json as config file with reporter configuration like

{
  "reporter": {
    "json" : {
      "stdout" : false
      "file": "test_path/output-result.json"
    }
}

Ran inspec with the command:
inspec shell -c "platform.params" --config test-config.json

It should ideally print the output to the file, but it does not obey the stdout: false of the config file.

Problem:
It still prints out on the screen and does not write to the file test_path/output-result.json.

Found while using inspec version: 5.22.9

Possible Solution

@Nik08 Nik08 changed the title Inspec shell's commandor alias -c option does not obey stdout false for reporter set using config file Inspec shell's commandor alias -c option does not obey stdout: false reporter option set using config file Jul 19, 2023
@Vasu1105
Copy link
Contributor

inspec shell is an interactive tool for debugging. -c option is also used to run single command string without launching the inspec shell which according to me also provided for debugging and as a user I will expect the output of the command should be shown on stdout, so as far as I understand this is expected behavior and not a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants