Add --quiet switch
See original GitHub issueI’m submitting a…
- bug report
- feature request
What is the current behavior?
Running Spectral lint with JSON output and then piping standard output to another program fails because the logging to standard output gets sent along with the JSON output and fails to parse.
For example, imagine an invalid OpenAPI document consisting only of:
openapi: 3.0.1
Running an incredibly simple pipeline like this fails:
$ spectral lint --format=json c.yaml | jq '.[]'
parse error: Invalid numeric literal at line 1, column 8
Because stdout looks like this:
Linting c.yaml
OpenAPI 3.x detected
[
{
"code": "info-contact",
What is the expected behavior?
Standard output with JSON output should be parseable so that spectral
can be used in scripts.
What is the motivation / use case for changing the behavior?
Using Spectral in a script. It is possible to work around this by dumping the JSON to a temp file with -o
, but that complicates some scripts.
Please tell us about your environment:
- Version: 2.1.0
- Framework: [ ]
- Language: [all]
> $ spectral --version
@stoplight/spectral/2.1.0 linux-x64 node-v10.12.0
Other information
N/A
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
The Complete Guide to MSI Switches for Silent Software ...
The Complete Guide to MSI Switches for Silent Software Installation ... Those pairs might identify an install folder, or add a license key,...
Read more >Command line switches supported by Self-Extractor packages
Describes the command line switches supported by a software installation package, ... /quiet, Runs the package in silent mode.
Read more >5 ways to find silent install parameters - PDQ
2. Use Google to find silent install parameters ... This information is usually pretty easy to find for most mainstream applications. However, ...
Read more >How to deploy MSI which has no silence install switch?
Silent installation is a built-in feature of Windows Installer and should work for all MSI files (unless actively blocked by modifications ...
Read more >Unattended/Silent Installation Switches for Windows Apps
Of course, you can try running the installer with the /? switch to find out which other switches it supports. But if you...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is now in progress
I think this is more of a feature request for a --quiet switch. It’s helpful for some output to happen by default because it acts as a guide for people who are still learning how the tool works. There is --verbose which gets way more chatty, so we can add --quiet which does nothing at all. This is fairly standard with things like apt-get being shushed with -y instead of asking for stdin yes/no, etc.