Skip to content

afpcmd: pagination for long directory listings#286

Merged
rdmark merged 1 commit into
mainfrom
afpcmd-pagination
Jul 7, 2026
Merged

afpcmd: pagination for long directory listings#286
rdmark merged 1 commit into
mainfrom
afpcmd-pagination

Conversation

@rdmark

@rdmark rdmark commented Jul 7, 2026

Copy link
Copy Markdown
Member

we previously had a hard coded limit of 256 entries when listing directories in afpcmd, but now we get a dynamic pagination that is sensitive to the number of rows in the current terminal

when the terminal dimensions cannot be determined, we use the 256 entries fallback

@rdmark rdmark requested a review from andylemin as a code owner July 7, 2026 14:05
@augmentcode

augmentcode Bot commented Jul 7, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Adds interactive pagination to afpcmd directory listings, replacing the previous hard cap of 256 entries.

Changes:

  • Introduce a directory listing pager that prints one “screen” at a time and prompts between pages.
  • Derive the page size from terminal height (rows minus one prompt row), with a 256-entry fallback when terminal size can’t be queried.
  • Fetch directory entries incrementally via repeated afp_sl_readdir() calls (256-entry batches) and assemble per-screen output.
  • Support continuing to the next page with any key and stopping early via q.
  • Update NEWS.md and remove the completed pagination item from TODO.md.
  • Add interactive tests to verify both “continue” pagination and “quit” behavior.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread cmdline/cmdline_afp.c Outdated
Comment thread cmdline/cmdline_afp.c Outdated
@rdmark rdmark force-pushed the afpcmd-pagination branch from 8d3d6f2 to 780d2fe Compare July 7, 2026 14:13
@rdmark

rdmark commented Jul 7, 2026

Copy link
Copy Markdown
Member Author

example of what the pagination looks like

-rw-r--r--      4096 2025-12-21 17:07 ._.DS_Store
-rw-r--r--      4096 2025-12-22 12:09 ._Screenshot 2024-02-06 at 9.50.53.png
-rw-r--r--      8196 2026-04-28 07:46 .DS_Store
-rw-rw-rw-         0 2026-03-09 18:58 AppleShare Server Messages
-rw-r--r--      3779 2025-10-14 23:13 backup_demo.c
-rw-r--r--      1101 2025-11-27 23:19 binhex.h
-rw-r--r--      1974 2025-11-27 23:19 BLURB
-rw-r--r--    511108 2025-11-01 13:35 bstring-1.0.3.tar.gz
-rw-r--r--     29985 2025-06-27 21:40 cnid-design-doc.rtf
-rw-rw-r--       311 2026-01-01 22:42 config
-rw-r--r--      4173 2025-11-27 23:52 config.h.in
-rw-r--r--      1172 2025-11-27 23:19 copyin.h
-rw-r--r--     17976 2025-11-27 23:19 COPYING
-rw-r--r--     18682 2025-11-27 22:44 debdiff-hfsutils-gcc14
-rw-r--r--      3575 2023-05-30 03:16 docker-rootful.yaml
-rw-rw-rw-         0 2026-03-22 08:44 Icon
-rw-r--r--       754 2025-10-17 09:40 Makefile
drwxr-xr-x         0 2024-03-28 14:20 Network Trash Folder
-rw-r--r-- 142570408 2026-03-22 10:24 p.deb
-rw-rw-r-- 142570408 2024-05-19 02:58 pulsar_1.117.2024051704_amd64.deb
-rw-r--r--    441391 1970-01-01 01:00 Screenshot 2024-02-06 at 9.50.53.png
drwxr-xr-x         0 2024-03-28 14:20 Temporary Items
drwxrwxrwx         0 2025-12-21 18:05 test_recursive_delete_67093
-rw-r--r--        14 2026-07-07 14:18 testfile_000.txt
-rw-r--r--        14 2026-07-07 14:18 testfile_001.txt
-rw-r--r--        14 2026-07-07 14:18 testfile_002.txt
-- 26 entries shown; press any key for next page, or q to quit --

@rdmark rdmark force-pushed the afpcmd-pagination branch 2 times, most recently from 0dd4d7f to e71912e Compare July 7, 2026 14:40
we previously had a hard coded limit of 256 entries when listing
directories in afpcmd, but now we get a dynamic pagination that is
sensitive to the number of rows in the current terminal

when the terminal dimensions cannot be determined, we use the 256
entries fallback
@rdmark rdmark force-pushed the afpcmd-pagination branch from e71912e to 7047d2c Compare July 7, 2026 14:41
@sonarqubecloud

sonarqubecloud Bot commented Jul 7, 2026

Copy link
Copy Markdown

@rdmark rdmark merged commit 2fe2a62 into main Jul 7, 2026
20 checks passed
@rdmark rdmark deleted the afpcmd-pagination branch July 7, 2026 14:44
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