From 3f2d3b1520a49b50a75b11df0891d771530f69fd Mon Sep 17 00:00:00 2001 From: Sebastian Kuzminsky Date: Sun, 6 Jul 2025 00:21:25 -0600 Subject: [PATCH] add `ent show` --- src/bin/ent/main.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/bin/ent/main.rs b/src/bin/ent/main.rs index 3d6f80b..3561f4c 100644 --- a/src/bin/ent/main.rs +++ b/src/bin/ent/main.rs @@ -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(())