Merged
Conversation
This commit adds a new quiet mode option that suppresses all output except errors during processing. When quiet mode is enabled: - No informational messages are displayed (file counts, directory lists, moved file notifications, success messages) - Confirmation prompt is automatically skipped (same as -y/--yes option) - Only error messages are shown via stderr The README has been updated to document this new option with usage examples.
Added 6 new test cases to verify quiet mode functionality: 1. test_flatten_quiet_mode_basic - Verifies basic file moving works in quiet mode 2. test_flatten_quiet_mode_with_conflicts - Tests filename conflict resolution in quiet mode 3. test_flatten_quiet_mode_with_depth - Tests depth limiting works with quiet mode 4. test_flatten_quiet_mode_with_include_filter - Tests include filters work with quiet mode 5. test_flatten_quiet_mode_with_exclude_filter - Tests exclude filters work with quiet mode 6. test_flatten_quiet_vs_normal_same_result - Ensures quiet and normal modes produce identical file operations These tests ensure that quiet mode only affects output (suppressing stdout) while maintaining all functionality for file operations, error handling, and filtering.
Added test_flatten_quiet_mode_outputs_errors which verifies that error messages are still output to stderr even when quiet mode is enabled. The test creates a scenario where one file move fails (by creating a directory with the same name as the destination file) and another succeeds. It verifies: - The error causes the file move to fail (file remains in subdirectory) - The error message is written to stderr via eprintln! (unaffected by quiet mode) - Other file operations continue successfully - The moved file count reflects only successful moves This ensures quiet mode suppresses informational stdout but preserves error reporting via stderr. To manually verify stderr output, run: cargo test test_flatten_quiet_mode_outputs_errors -- --nocapture
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 commit adds a new quiet mode option that suppresses all output except errors during processing. When quiet mode is enabled:
The README has been updated to document this new option with usage examples.