hive-forge: rewrite bash CLI helper as a rust binary (closes #280)

This commit is contained in:
damocles 2026-05-25 01:30:44 +02:00 committed by Mara
commit 595e3c040c
28 changed files with 1434 additions and 612 deletions

View file

@ -0,0 +1,35 @@
//! Per-verb subcommand modules. Each module exposes a `Args` struct
//! (clap-derived) and a `run` fn taking `(&Client, Args) -> Result<()>`.
//! Splitting one verb per module keeps each handler small and avoids
//! the bash script's monolithic `case` statement.
pub mod assign;
pub mod attach;
pub mod branches;
pub mod close;
pub mod comment;
pub mod comment_edit;
pub mod comment_show;
pub mod diff;
pub mod issue;
pub mod issue_create;
pub mod issue_edit;
pub mod labels;
pub mod milestone;
pub mod pr;
pub mod pr_create;
pub mod pr_reviews;
pub mod subscription;
pub mod tree_sha;
pub mod view;
use anyhow::Result;
use serde_json::Value;
/// Pretty-print a `serde_json` value to stdout with a trailing newline,
/// matching the bash script's `| jq` output shape.
pub(crate) fn print_json(v: &Value) -> Result<()> {
let s = serde_json::to_string_pretty(v)?;
println!("{s}");
Ok(())
}