ent show: add --comments <N> flag to limit comment output #40

Merged
SebKuzminsky merged 1 commit from sigil-03/77edd8168c8ab9a0a4eef251dfff5e82 into main 2026-09-04 19:14:33 +00:00
Owner

Overview

Adds a --comments flag to ent show <ISSUE_ID> that limits comment output to the N most recent comments, similar to git log -n. Issues with long comment threads currently produce very long show output; this makes quick check-ins on recent discussion practical.

Changes

Single file: src/bin/ent/main.rs

  • Commands::Show gains a comments: Option field (#[arg(long)]). clap parses the value and rejects non-integers and negatives.
  • The show handler slices issue.comments to the last N entries and prints a truncation hint — (showing last N of M comments) — before the comments.
# Overview Adds a --comments <N> flag to ent show <ISSUE_ID> that limits comment output to the N most recent comments, similar to git log -n. Issues with long comment threads currently produce very long show output; this makes quick check-ins on recent discussion practical. # Changes Single file: src/bin/ent/main.rs - Commands::Show gains a comments: Option<u32> field (#[arg(long)]). clap parses the value and rejects non-integers and negatives. - The show handler slices issue.comments to the last N entries and prints a truncation hint — (showing last N of M comments) — before the comments.
ent show: add --comments <N> flag to limit comment output
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
133297788f
Limit comment output to the N most recent comments, like git log -n.
Header and description are always shown. Prints a hint
'(showing last N of M comments)' when truncation occurs (N in
1..M). N=0 shows no comments; N > total shows all with no hint;
omitting the flag preserves existing behavior.

Issue: 77edd8168c8ab9a0a4eef251dfff5e82
sigil-03 force-pushed sigil-03/77edd8168c8ab9a0a4eef251dfff5e82 from 133297788f
Some checks are pending
Code Checks / clippy (push) Waiting to run
Code Checks / test (push) Waiting to run
Code Checks / clippy (pull_request) Waiting to run
Code Checks / test (pull_request) Waiting to run
to 361bb1eb10
Some checks failed
Code Checks / clippy (push) Has been cancelled
Code Checks / test (push) Has been cancelled
Code Checks / clippy (pull_request) Has been cancelled
Code Checks / test (pull_request) Has been cancelled
2026-09-04 17:33:54 +00:00
Compare
@ -56,0 +57,4 @@
/// Only show the most recent N comments.
#[arg(long)]
comments: Option<u32>,
Owner

This is a nitpick but i'd prefer if this argument (and the de-structured variable below) was named "--num-comments" (maybe with a short of "-n") to more clearly show what it does.

This is a nitpick but i'd prefer if this argument (and the de-structured variable below) was named "--num-comments" (maybe with a short of "-n") to more clearly show what it does.
Author
Owner

we can totally do that - i wasn't sure what to call it so this is what i landed on, but i'm not tied to it.

we can totally do that - i wasn't sure what to call it so this is what i landed on, but i'm not tied to it.
SebKuzminsky deleted branch sigil-03/77edd8168c8ab9a0a4eef251dfff5e82 2026-09-04 19:14:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
taproot-manufacturing/entomologist!40
No description provided.