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
[SR-15037] Add --quiet option to swift run
#4395
Comments
@swift-ci create |
I'd also like to see this for e.g.
|
I don't have much to add other than my voice to say that I would also benefit from a |
@hassila @BenchR267 would you like to make a PR for this? SwiftPM has |
@tomerd I went ahead and followed your suggestions and opened the above PR |
I notice although the quiet flag is there when running |
It should affect everything imho |
I'm also curious about this. USAGE: swift test <options> <subcommand>
OPTIONS:
...
-v, --verbose Increase verbosity to include informational output
--very-verbose, --vv Increase verbosity to include debug output
-q, --quiet Decrease verbosity to only include error output. However, passed test cases are printed out, too. I'm using Quick/Nimble. |
@superarts @doozMen @neonichu what would you expect the output to be in the
The entire output? The lines that contain
Just the failure lines?
Just the summary?
Something else? I would think that for simplicity's sake, the entire output should be kept. |
Agreed. As a developer, I would say we usually don't care about any successful cases at all (unless metrics data like the total success numbers and coverages etc), but we do expect to see all the details about the failed cases, to help us debugging. And the fact that we are taking about the CLI command here indicates a lot of us solely depend on CLI without Xcode. In this case, the purpose is a bit different with the traditional "--quite" use case, which usually indicates user just wants to see very brief summary. So some other arguments like "--failed-output-only" would make more sense here. |
I've started work on resolving the concerns that were raised (I agree, Merry Christmas, I guess 🎄🎅🏻😅 |
Okay I have a working solution for Without:
With:
Working to close the gap between those two. |
Okay, based on this comment:
I believe the progress animation- and terminal controller-specific output should be omitted when using the Please correct me if I'm wrong, @tomerd or anyone else. |
Additional Detail from JIRA
md5: c5f31e82419529323d967dcf872f390c
Issue Description:
`swift run` is often used for running Swift scripts. When running those scripts from other scripts, the output is in an expected format and should not contain any output from SwiftPM itself.
Currently, all output from SwiftPM seems to be printed on stderr so it's an option to nuke that in those situations (`2>>/dev/null`). But that doesn't work if the script itself is using stderr too.
I propose to add a new option to `swift run` which suppresses all output about building the script and only prints the output of the executable itself, `--quiet`.
Open for discussion is how build failures are surfaced to the user and I don't have a strong opinion on that. It could suppress that too making the command fail silently and only provide the exit status as indicator for failure or it could print those out instead since the executable will never run anyway.
The text was updated successfully, but these errors were encountered: