hive-forge: global -r/--repo flag instead of per-verb [repo] positional (mara@#407)

This commit is contained in:
damocles 2026-05-25 02:12:04 +02:00 committed by Mara
parent 76cf2ffd36
commit badf21714b
21 changed files with 46 additions and 85 deletions

View file

@ -30,6 +30,11 @@ use clap::{Parser, Subcommand};
disable_help_subcommand = true
)]
struct Cli {
/// Repo override (default from `HIVE_FORGE_REPO`).
/// Applies to any verb; replaces the per-verb `[repo]` trailing
/// positional the bash helper used.
#[arg(short = 'r', long, global = true)]
repo: Option<String>,
#[command(subcommand)]
verb: Verb,
}
@ -80,7 +85,7 @@ enum Verb {
fn main() -> Result<()> {
let cli = Cli::parse();
let client = client::Client::from_env().context("initialize forge client")?;
let client = client::Client::from_env(cli.repo).context("initialize forge client")?;
match cli.verb {
Verb::View(a) => verbs::view::run(&client, a),
Verb::Issue(a) => verbs::issue::run(&client, a),