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 3d8413b875d16477c8737897e164aa7371d110f2
parent eb92301523cf696ccc2139110e81fe14b23b0337
2 pending (2 total) View logs
2 files changed +19 -14
modified crates/radicle-cli/src/commands/unseed.rs
@@ -1,22 +1,11 @@
-
use clap::Parser;
+
pub mod args;

use radicle::{prelude::*, Node};

use crate::terminal as term;

-
pub(crate) const ABOUT: &str = "Remove repository seeding policies";
-

-
const LONG_ABOUT: &str = r#"
-
The `unseed` command removes the seeding policy, if found,
-
for the given repositories."#;
-

-
#[derive(Debug, Parser)]
-
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
-
pub struct Args {
-
    /// ID of the repository to remove the seeding policy for (may be repeated)
-
    #[arg(value_name = "RID", required = true, action = clap::ArgAction::Append)]
-
    rids: Vec<RepoId>,
-
}
+
pub use args::Args;
+
pub(crate) use args::ABOUT;

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

+
pub(crate) const ABOUT: &str = "Remove repository seeding policies";
+

+
const LONG_ABOUT: &str = r#"
+
The `unseed` command removes the seeding policy, if found,
+
for the given repositories."#;
+

+
#[derive(Debug, Parser)]
+
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
+
pub struct Args {
+
    /// ID of the repository to remove the seeding policy for (may be repeated)
+
    #[arg(value_name = "RID", required = true, action = clap::ArgAction::Append)]
+
    pub rids: Vec<RepoId>,
+
}