hive-forge: surface comment/issue attachments in comments/view/comment-show/issue
This commit is contained in:
parent
ecf9ff4d80
commit
6f3ac755e0
5 changed files with 93 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ use forgejo_api::structs::{IssueGetCommentsQuery, StateType};
|
|||
|
||||
use crate::client::{Client, index};
|
||||
use crate::notify;
|
||||
use crate::verbs::attachment_line;
|
||||
|
||||
#[derive(ClapArgs)]
|
||||
pub struct Args {
|
||||
|
|
@ -47,6 +48,11 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
|
|||
println!();
|
||||
println!("{body}");
|
||||
}
|
||||
for a in issue.assets.as_deref().unwrap_or_default() {
|
||||
if let Some(line) = attachment_line(a) {
|
||||
println!("{line}");
|
||||
}
|
||||
}
|
||||
let (_, comments) = client
|
||||
.api()
|
||||
.issue_get_comments(
|
||||
|
|
@ -70,6 +76,11 @@ pub fn run(client: &Client, args: Args) -> Result<()> {
|
|||
.unwrap_or("?");
|
||||
let cb = c.body.as_deref().unwrap_or("");
|
||||
println!("**{cu}**: {cb}");
|
||||
for a in c.assets.as_deref().unwrap_or_default() {
|
||||
if let Some(line) = attachment_line(a) {
|
||||
println!("{line}");
|
||||
}
|
||||
}
|
||||
println!();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue