add ent show
This commit is contained in:
parent
ba0862f5a6
commit
3f2d3b1520
1 changed files with 18 additions and 0 deletions
|
|
@ -26,6 +26,9 @@ enum Commands {
|
|||
|
||||
/// Edit the description of an issue.
|
||||
Edit { issue_id: String },
|
||||
|
||||
/// Show the full description of an issue.
|
||||
Show { issue_id: String },
|
||||
}
|
||||
|
||||
fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<()> {
|
||||
|
|
@ -61,6 +64,21 @@ fn handle_command(args: &Args, issues_dir: &std::path::Path) -> anyhow::Result<(
|
|||
}
|
||||
}
|
||||
}
|
||||
Commands::Show { issue_id } => {
|
||||
let issues =
|
||||
entomologist::issues::Issues::new_from_dir(std::path::Path::new(issues_dir))?;
|
||||
match issues.issues.get(issue_id) {
|
||||
Some(issue) => {
|
||||
println!("issue {}", issue_id);
|
||||
println!("state {:?}", issue.state);
|
||||
println!("");
|
||||
println!("{}", issue.description);
|
||||
}
|
||||
None => {
|
||||
println!("issue {} not found", issue_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue