Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This adds the switch
--stdio
which will skip the provided list of files and instead process the text that is provided via stdin. The formatted output is then written to stdout.The list of files is now no longer a required argument, but within the
Cli::resolve
method, it is ensured that either the--stdin
flag is set, or at least one file is provided. Also, the method warns if a list of filenames is provided and the--stdio
flag is set, and then clears the list of files and processes just stdin.The logging is now initialized a bit earlier in the
main()
method, which allows writing a one-off error message (by invokinglog::error!
/log::warn!
) withinCli::resolve
.