radicle_cli/commands/
unseed.rs

1pub mod args;
2
3use radicle::{prelude::*, Node};
4
5use crate::terminal as term;
6
7pub use args::Args;
8pub(crate) use args::ABOUT;
9
10pub fn run(options: Args, ctx: impl term::Context) -> anyhow::Result<()> {
11    let profile = ctx.profile()?;
12    let mut node = radicle::Node::new(profile.socket());
13
14    for rid in options.rids {
15        delete(rid, &mut node, &profile)?;
16    }
17
18    Ok(())
19}
20
21pub fn delete(rid: RepoId, node: &mut Node, profile: &Profile) -> anyhow::Result<()> {
22    if profile.unseed(rid, node)? {
23        term::success!("Seeding policy for {} removed", term::format::tertiary(rid));
24    }
25    Ok(())
26}