hive-forge: dedup the --json refusal into refuse_json(), test it, cover attachment-get/artifact-get too
This commit is contained in:
parent
e0ad3a567b
commit
e18497bb70
8 changed files with 58 additions and 27 deletions
|
|
@ -20,6 +20,7 @@ use anyhow::{Context, Result, bail};
|
|||
use clap::Args as ClapArgs;
|
||||
|
||||
use crate::client::Client;
|
||||
use crate::verbs::refuse_json;
|
||||
|
||||
#[derive(ClapArgs)]
|
||||
pub struct Args {
|
||||
|
|
@ -39,9 +40,7 @@ pub struct Args {
|
|||
/// Returns an error if the `git clone` shellout fails (bad repo, auth
|
||||
/// rejected, network) or the destination can't be derived.
|
||||
pub fn run(client: &Client, args: Args) -> Result<()> {
|
||||
if client.json_mode() {
|
||||
bail!("hive-forge clone: --json is not supported for this verb, only the destination path");
|
||||
}
|
||||
refuse_json(client.json_mode(), "clone", "only the destination path")?;
|
||||
let repo = client.repo()?;
|
||||
let dest = match args.dest {
|
||||
Some(d) => d,
|
||||
|
|
|
|||
Loading…
Reference in a new issue