Add a command-line option for quiet output
- Dominant language
- C#
- Stars
- 11.5k
- Forks
- 960
- PR merge metrics
- No merged PRs in 30d
Description
### Checklist
- [X] I have verified this is the correct repository for opening this issue.
- [X] I have verified no other issues exist related to my request.
### Is Your Feature Request Related To A Problem? Please describe.
Choco prints a lot of unnecessary information with no simple way to suppress it. Consider this output from `choco install ninja --version 1.10.2 --yes --allow-downgrade`:
```
Chocolatey v2.2.2
Installing the following packages:
ninja
By installing, you accept licenses for the packages.
ninja v1.10.2 already installed.
Use --force to reinstall, specify a version to install, or try upgrade.
Chocolatey installed 0/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
Warnings:
- ninja - ninja v1.10.2 already installed.
Use --force to reinstall, specify a version to install, or try upgrade.
```
When the command is run manually, it may make sense to show this. However, when it's run from a script, really none of these messages need to be shown and they just pollute the output.
### Describe The Solution. Why is it needed?
`--quiet` command-line option should be added. The option should cause only errors to be printed. If the caller wanted to suppress warnings too, they should redirect the standard error stream to null (but see the issue listed as related).
Option `--limit-output` is not a solution here, because it suppresses the errors too.
### Additional Context
In Python package manager `pip`, [`--quiet`](https://pip.pypa.io/en/stable/cli/pip/#cmdoption-q) is additive, and can be used up to 3 times (corresponding to WARNING, ERROR, and CRITICAL logging levels). It's the opposite of [`--verbose`](https://pip.pypa.io/en/stable/cli/pip/#cmdoption-v).
### Related Issues
- #1466
Contributor guide
Research direction
Start by tracing how Chocolatey parses global command-line options and routes informational messages versus errors; the issue does not name specific files or tests. Compare the requested --quiet behavior with --limit-output and the example install command, and consider the work done when quiet mode leaves errors visible without suppressing them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100