From eff40166c9ac8ad9776ecb6160d245220bfb1f87 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Wed, 21 Feb 2024 17:49:02 +0100 Subject: [PATCH] cli: Add `rad unseed` command This replaces the `-d` flag of `rad seed`, making it more like `rad unfollow`. --- radicle-cli/examples/rad-unseed.md | 2 +- radicle-cli/src/commands.rs | 2 + radicle-cli/src/commands/help.rs | 1 + radicle-cli/src/commands/seed.rs | 40 ++++----------- radicle-cli/src/commands/unseed.rs | 79 ++++++++++++++++++++++++++++++ radicle-cli/src/main.rs | 7 +++ 6 files changed, 100 insertions(+), 31 deletions(-) create mode 100644 radicle-cli/src/commands/unseed.rs diff --git a/radicle-cli/examples/rad-unseed.md b/radicle-cli/examples/rad-unseed.md index 4bc06875..b26cb08c 100644 --- a/radicle-cli/examples/rad-unseed.md +++ b/radicle-cli/examples/rad-unseed.md @@ -12,7 +12,7 @@ $ rad ls We could stop seeding it if we didn't want other nodes to fetch it from us: ``` -$ rad seed --delete rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji +$ rad unseed rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji ✓ Seeding policy for rad:z42hL2jL4XNk6K8oHQaSWfMgCL7ji removed ``` diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs index 515a3ab4..4f2abe9f 100644 --- a/radicle-cli/src/commands.rs +++ b/radicle-cli/src/commands.rs @@ -52,5 +52,7 @@ pub mod rad_stats; pub mod rad_sync; #[path = "commands/unfollow.rs"] pub mod rad_unfollow; +#[path = "commands/unseed.rs"] +pub mod rad_unseed; #[path = "commands/watch.rs"] pub mod rad_watch; diff --git a/radicle-cli/src/commands/help.rs b/radicle-cli/src/commands/help.rs index e6c5410d..0dcd2718 100644 --- a/radicle-cli/src/commands/help.rs +++ b/radicle-cli/src/commands/help.rs @@ -35,6 +35,7 @@ const COMMANDS: &[Help] = &[ rad_seed::HELP, rad_follow::HELP, rad_unfollow::HELP, + rad_unseed::HELP, rad_remote::HELP, rad_stats::HELP, rad_sync::HELP, diff --git a/radicle-cli/src/commands/seed.rs b/radicle-cli/src/commands/seed.rs index f168debe..e5a12189 100644 --- a/radicle-cli/src/commands/seed.rs +++ b/radicle-cli/src/commands/seed.rs @@ -20,14 +20,13 @@ pub const HELP: Help = Help { usage: r#" Usage - rad seed [] [-d | --delete] [--[no-]fetch] [--scope ] [