Skip to content

--show-all-files flag to avoid preview_moves truncation#1

Merged
fognil merged 1 commit intofognil:mainfrom
djanatyn:djan/show-all-files
Feb 16, 2026
Merged

--show-all-files flag to avoid preview_moves truncation#1
fognil merged 1 commit intofognil:mainfrom
djanatyn:djan/show-all-files

Conversation

@djanatyn
Copy link
Copy Markdown
Contributor

When previewing changes with more than 5 files going into a particular folder, the remaining files will be truncated with some ... and <n> more text:

./target/release/neatcli organize /tmp/neatcli-test-showallfiles
→ Scanning /private/tmp/neatcli-test-showallfiles (organizing by type)...
Preview:
────────────────────────────────────────────────────────────
  Documents (10 files)
    → file2.txt
    → file3.txt
    → file1.txt
    → file4.txt
    → file5.txt
    → ... and 5 more
  Images (8 files)
    → image8.jpg
    → image7.jpg
    → image6.jpg
    → image4.jpg
    → image5.jpg
    → ... and 3 more
────────────────────────────────────────────────────────────
Summary: 18 files to move (0 B)
ℹ Use --execute to execute these changes.

This was hard-coded into the program in src/core/organizer.rs:preview_moves, and using the --verbose flag didn't show the rest of the files:

// Show first 5 files in each folder
for mv in files.iter().take(5) {
    let from_name = mv.from.file_name().unwrap_or_default().to_string_lossy();
    println!("    {} {}", "→".dimmed(), from_name);
}

if files.len() > 5 {
    println!("    {} ... and {} more", "→".dimmed(), files.len() - 5);
}

This PR adds a new --show-all-files flag to neatcli organize:

❯ ./target/debug/neatcli organize --help
Organize files by type or date

Usage: neatcli organize [OPTIONS] [PATHS]...

Arguments:
  [PATHS]...  Target directories to organize (supports multiple paths) [default: .]

Options:
      --by-type                    Organize files by their type (Images, Documents, Videos, etc.)
      --by-date                    Organize files by date (YYYY/MM structure)
      --by-extension               Organize files by extension
      --by-camera                  Organize images by camera model (from EXIF data)
      --by-date-taken              Organize images by date taken (from EXIF data, more accurate)
      --by-artist                  Organize audio files by artist (from ID3/audio tags)
      --by-album                   Organize audio files by album (Artist/Album structure)
  -n, --dry-run                    Preview changes without executing (default behavior)
  -e, --execute                    Actually execute the changes
  -I, --ignore <IGNORE>            Patterns to ignore (can be specified multiple times)
      --min-size <MIN_SIZE>        Minimum file size to include (e.g., 1MB, 10KB, 1G)
      --max-size <MAX_SIZE>        Maximum file size to include (e.g., 100MB, 1GB)
      --after <AFTER>              Only include files modified after this date (YYYY-MM-DD)
      --before <BEFORE>            Only include files modified before this date (YYYY-MM-DD)
  -v, --verbose                    Enable verbose output
  -c, --copy                       Copy files instead of moving
  -q, --quiet                      Suppress all output except errors
  -r, --recursive                  Scan subdirectories recursively
      --startswith <STARTSWITH>    Filter files starting with string
      --endswith <ENDSWITH>        Filter files ending with string (before extension)
      --contains <CONTAINS>        Filter files containing string
      --regex <REGEX>              Filter by regex pattern
      --mime <MIME>                Filter by MIME type (e.g., "image/*", "application/pdf")
      --content <CONTENT>          Filter files containing this text in their content (TXT, MD, JSON, etc.)
      --template <TEMPLATE>        Custom destination template (e.g., "{year}/{month}/{category}/{filename}")
      --on-conflict <ON_CONFLICT>  How to handle file conflicts (skip, overwrite, rename, ask) [default: rename]
      --show-all-files             Show all files in each folder
  -h, --help                       Print help
  -V, --version                    Print version

When used, it will show all the files being moved instead of just the first 5:

./target/release/neatcli organize /tmp/neatcli-test-showallfiles --show-all-files
→ Scanning /private/tmp/neatcli-test-showallfiles (organizing by type)...
Preview:
────────────────────────────────────────────────────────────
  Documents (10 files)
    → file2.txt
    → file3.txt
    → file1.txt
    → file4.txt
    → file5.txt
    → file7.txt
    → file6.txt
    → file10.txt
    → file8.txt
    → file9.txt
  Images (8 files)
    → image8.jpg
    → image7.jpg
    → image6.jpg
    → image4.jpg
    → image5.jpg
    → image1.jpg
    → image2.jpg
    → image3.jpg
────────────────────────────────────────────────────────────
Summary: 18 files to move (0 B)
ℹ Use --execute to execute these changes.

I'm not sure if adding a new flag is appropriate here - maybe we could instead modify the behavior of the --verbose flag? I was surprised when passing --verbose didn't show all the files being changed.

@djanatyn djanatyn force-pushed the djan/show-all-files branch from cab1e55 to 1093897 Compare February 15, 2026 18:55
@fognil
Copy link
Copy Markdown
Owner

fognil commented Feb 16, 2026

Thanks for the contribution! Clean and well-scoped change.

One minor thought: could also consider exposing --show-all-files on quick and profile run commands in a follow-up,
since they also truncate at 5 files. But not a blocker.

LGTM, merging!

@fognil fognil merged commit 7fa9d3c into fognil:main Feb 16, 2026
8 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