hive-forge: global -r/--repo flag instead of per-verb [repo] positional (mara@#407)
This commit is contained in:
parent
76cf2ffd36
commit
badf21714b
21 changed files with 46 additions and 85 deletions
|
|
@ -11,12 +11,10 @@ use crate::client::Client;
|
|||
pub struct Args {
|
||||
/// Issue or PR number.
|
||||
number: u64,
|
||||
/// Repo override (default from `HIVE_FORGE_REPO`).
|
||||
repo: Option<String>,
|
||||
}
|
||||
|
||||
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||
let repo = client.repo(args.repo.as_deref());
|
||||
let repo = client.repo();
|
||||
let issue = client.get_json(&format!("/repos/{repo}/issues/{}", args.number))?;
|
||||
let title = issue.get("title").and_then(Value::as_str).unwrap_or("");
|
||||
let body = issue.get("body").and_then(Value::as_str).unwrap_or("");
|
||||
|
|
|
|||
Loading…
Reference in a new issue