Skip to content

Add quiet mode option (-q/--quiet)#7

Merged
adnissen merged 4 commits intomainfrom
claude/add-quiet-option-011CUr5xvrsZbyDxr5CxtEnd
Nov 6, 2025
Merged

Add quiet mode option (-q/--quiet)#7
adnissen merged 4 commits intomainfrom
claude/add-quiet-option-011CUr5xvrsZbyDxr5CxtEnd

Conversation

@adnissen
Copy link
Copy Markdown
Owner

@adnissen adnissen commented Nov 6, 2025

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.

claude and others added 4 commits November 6, 2025 05:33
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
@adnissen adnissen merged commit 5d3144c into main Nov 6, 2025
1 check 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