Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
REVIEW: move args to module
◌ CI pending Erik Kundt committed 7 months ago
commit 58a4f9feee301aad7984ab5cec33925c7d289159
parent 72f7368254ed14b3c4b3ac09661fc023884d25b9
1 pending (1 total) View logs
2 files changed +28 -23
modified crates/radicle-cli/src/commands/clean.rs
@@ -1,32 +1,12 @@
-
use clap::Parser;
+
mod args;

-
use radicle::identity::RepoId;
use radicle::storage;
use radicle::storage::WriteStorage;

use crate::terminal as term;

-
pub const ABOUT: &str = "Remove all remotes from a repository";
-

-
const LONG_ABOUT: &str = r#"
-
Removes all remotes from a repository, as long as they are not the
-
local operator or a delegate of the repository.
-

-
Note that remotes will still be fetched as long as they are
-
followed and/or the follow scope is "all".
-
"#;
-

-
#[derive(Debug, Parser)]
-
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
-
pub struct Args {
-
    /// Operate on the given repository
-
    #[arg(value_name = "RID")]
-
    pub(crate) repo: RepoId,
-

-
    /// Do not ask for confirmation before removal
-
    #[arg(long)]
-
    pub(crate) 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/clean/args.rs
@@ -0,0 +1,25 @@
+
use clap::Parser;
+

+
use radicle::prelude::RepoId;
+

+
pub const ABOUT: &str = "Remove all remotes from a repository";
+

+
const LONG_ABOUT: &str = r#"
+
Removes all remotes from a repository, as long as they are not the
+
local operator or a delegate of the repository.
+

+
Note that remotes will still be fetched as long as they are
+
followed and/or the follow scope is "all".
+
"#;
+

+
#[derive(Debug, Parser)]
+
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
+
pub struct Args {
+
    /// Operate on the given repository
+
    #[arg(value_name = "RID")]
+
    pub(crate) repo: RepoId,
+

+
    /// Do not ask for confirmation before removal
+
    #[arg(long)]
+
    pub(crate) no_confirm: bool,
+
}