diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-04 15:23:54 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2026-03-04 15:23:54 +0000 |
| commit | b4c7b5e24d05aef878e155a1bedc22de54609fbb (patch) | |
| tree | 112334b99758251d4b784c33a8d64ba43ca1bd12 /src/bin/ngit/main.rs | |
| parent | 7f7827e445029799400aacf69838e26299b6dc10 (diff) | |
add --comments flag to issue/pr view; show reply threading
- issue view and pr view now show only a comment count by default
- pass --comments to include the full thread
- JSON output always includes comment_count; comments array only with --comments
- each comment in the thread includes reply_to (null for top-level, parent
comment id for replies)
- human-readable view shows a dim '↳ reply to <short-id>' line on replies
Diffstat (limited to 'src/bin/ngit/main.rs')
| -rw-r--r-- | src/bin/ngit/main.rs | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index 03a5ce9..4c1aa75 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs | |||
| @@ -60,11 +60,20 @@ async fn main() { | |||
| 60 | json, | 60 | json, |
| 61 | id, | 61 | id, |
| 62 | offline, | 62 | offline, |
| 63 | } => sub_commands::list::launch(status.clone(), *json, id.clone(), *offline).await, | 63 | } => { |
| 64 | PrCommands::View { id, json, offline } => { | 64 | sub_commands::list::launch(status.clone(), *json, false, id.clone(), *offline) |
| 65 | .await | ||
| 66 | } | ||
| 67 | PrCommands::View { | ||
| 68 | id, | ||
| 69 | json, | ||
| 70 | comments, | ||
| 71 | offline, | ||
| 72 | } => { | ||
| 65 | sub_commands::list::launch( | 73 | sub_commands::list::launch( |
| 66 | "open,draft,closed,applied".to_string(), | 74 | "open,draft,closed,applied".to_string(), |
| 67 | *json, | 75 | *json, |
| 76 | *comments, | ||
| 68 | Some(id.clone()), | 77 | Some(id.clone()), |
| 69 | *offline, | 78 | *offline, |
| 70 | ) | 79 | ) |
| @@ -122,16 +131,23 @@ async fn main() { | |||
| 122 | status.clone(), | 131 | status.clone(), |
| 123 | hashtag.clone(), | 132 | hashtag.clone(), |
| 124 | *json, | 133 | *json, |
| 134 | false, | ||
| 125 | id.clone(), | 135 | id.clone(), |
| 126 | *offline, | 136 | *offline, |
| 127 | ) | 137 | ) |
| 128 | .await | 138 | .await |
| 129 | } | 139 | } |
| 130 | IssueCommands::View { id, json, offline } => { | 140 | IssueCommands::View { |
| 141 | id, | ||
| 142 | json, | ||
| 143 | comments, | ||
| 144 | offline, | ||
| 145 | } => { | ||
| 131 | sub_commands::issue_list::launch( | 146 | sub_commands::issue_list::launch( |
| 132 | "open,draft,closed,applied".to_string(), | 147 | "open,draft,closed,applied".to_string(), |
| 133 | None, | 148 | None, |
| 134 | *json, | 149 | *json, |
| 150 | *comments, | ||
| 135 | Some(id.clone()), | 151 | Some(id.clone()), |
| 136 | *offline, | 152 | *offline, |
| 137 | ) | 153 | ) |