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

Add --stdio to process STDIN #21

Merged
merged 1 commit into from
Sep 10, 2024
Merged

Conversation

leonbohn
Copy link
Contributor

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 invoking log::error!/log::warn!) within Cli::resolve.

@leonbohn leonbohn mentioned this pull request Sep 10, 2024
@WGUNDERWOOD
Copy link
Owner

Thank you, this looks great! I will merge it and make a few small edits myself.

@WGUNDERWOOD WGUNDERWOOD merged commit 506430a into WGUNDERWOOD:main Sep 10, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants