Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: Move args to module
✗ CI failure Erik Kundt committed 6 months ago
commit 2f1a4b485d18f572d46244ccb7e39af7dfafeee6
parent 951c24e6338437570c5a8288084a48f39cf3da73
2 failed (2 total) View logs
2 files changed +27 -20
modified crates/radicle-cli/src/commands/checkout.rs
@@ -1,11 +1,11 @@
#![allow(clippy::box_default)]
+
mod args;
+

use std::path::PathBuf;

use anyhow::anyhow;
use anyhow::Context as _;

-
use clap::Parser;
-

use radicle::git;
use radicle::node::AliasStore;
use radicle::prelude::*;
@@ -14,24 +14,8 @@ use radicle::storage::git::transport;
use crate::project;
use crate::terminal as term;

-
pub(crate) const ABOUT: &str = "Checkout a repository into the local directory";
-
const LONG_ABOUT: &str = r#"
-
Creates a working copy from a repository in local storage.
-
"#;
-

-
#[derive(Debug, Parser)]
-
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
-
pub struct Args {
-
    /// Repository identity
-
    #[arg(value_name = "RID")]
-
    pub repo: RepoId,
-
    /// The DID of the remote peer to checkout
-
    #[arg(long)]
-
    pub remote: Option<Did>,
-
    /// Don't ask for confirmation during checkout
-
    #[arg(long)]
-
    pub no_confirm: bool,
-
}
+
pub use args::Args;
+
pub(crate) use args::ABOUT;

pub fn run(args: Args, ctx: impl term::Context) -> anyhow::Result<()> {
    let profile = ctx.profile()?;
added crates/radicle-cli/src/commands/checkout/args.rs
@@ -0,0 +1,23 @@
+
use clap::Parser;
+
use radicle::prelude::{Did, RepoId};
+

+
pub(crate) const ABOUT: &str = "Checkout a repository into the local directory";
+
const LONG_ABOUT: &str = r#"
+
Creates a working copy from a repository in local storage.
+
"#;
+

+
#[derive(Debug, Parser)]
+
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
+
pub struct Args {
+
    /// Repository ID of the repository to checkout
+
    #[arg(value_name = "RID")]
+
    pub repo: RepoId,
+

+
    /// The DID of the remote peer to checkout
+
    #[arg(long, value_name = "DID")]
+
    pub remote: Option<Did>,
+

+
    /// Don't ask for confirmation during checkout
+
    #[arg(long)]
+
    pub no_confirm: bool,
+
}