Skip to content

Add --top N flag to limit displayed files#20

Merged
MatthewMckee4 merged 1 commit intomainfrom
add-top-flag
Feb 16, 2026
Merged

Add --top N flag to limit displayed files#20
MatthewMckee4 merged 1 commit intomainfrom
add-top-flag

Conversation

@MatthewMckee4
Copy link
Member

Summary

  • Adds --top N CLI flag to show only the top N files by line count
  • Truncates file list in table and JSON output while keeping totals reflecting the full count
  • --top is a no-op with --summary since there is no per-file list

Closes #2

Test plan

  • top_truncates_table_output — top 2 of 3 files shown, totals reflect all 3
  • top_truncates_json_output — JSON has 2 files but full totals
  • top_is_noop_for_summary — summary unaffected by --top
  • top_zero_shows_no_files — --top 0 shows no files, totals intact
  • top_larger_than_file_count_shows_all — --top 100 with 2 files shows all

@MatthewMckee4 MatthewMckee4 added enhancement New feature or request cli Related to the command-line interface output Related to output formatting and display labels Feb 16, 2026
@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@MatthewMckee4 MatthewMckee4 merged commit e0f381b into main Feb 16, 2026
13 checks passed
@MatthewMckee4 MatthewMckee4 deleted the add-top-flag branch February 16, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface enhancement New feature or request output Related to output formatting and display

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --top flag to show only top N files

1 participant