From 6cfed884bf37cba1e0d8e97fa8b0e94df4a04b1f Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Mon, 20 Oct 2025 15:45:01 +0100 Subject: [PATCH] cli/remote: migrate to clap --- crates/radicle-cli/src/commands/help.rs | 5 +- crates/radicle-cli/src/commands/remote.rs | 189 ++---------------- .../radicle-cli/src/commands/remote/args.rs | 161 +++++++++++++++ crates/radicle-cli/src/main.rs | 5 +- 4 files changed, 186 insertions(+), 174 deletions(-) create mode 100644 crates/radicle-cli/src/commands/remote/args.rs diff --git a/crates/radicle-cli/src/commands/help.rs b/crates/radicle-cli/src/commands/help.rs index 5c012032..56275003 100644 --- a/crates/radicle-cli/src/commands/help.rs +++ b/crates/radicle-cli/src/commands/help.rs @@ -122,7 +122,10 @@ const COMMANDS: &[CommandItem] = &[ name: "unseed", about: crate::commands::unseed::ABOUT, }, - CommandItem::Lexopt(crate::commands::remote::HELP), + CommandItem::Clap { + name: "remote", + about: crate::commands::remote::ABOUT, + }, CommandItem::Clap { name: "stats", about: crate::commands::stats::ABOUT, diff --git a/crates/radicle-cli/src/commands/remote.rs b/crates/radicle-cli/src/commands/remote.rs index 77705470..16013bba 100644 --- a/crates/radicle-cli/src/commands/remote.rs +++ b/crates/radicle-cli/src/commands/remote.rs @@ -4,203 +4,48 @@ pub mod add; pub mod list; pub mod rm; -use std::ffi::OsString; +mod args; use anyhow::anyhow; -use radicle::git::fmt::RefString; -use radicle::prelude::NodeId; use radicle::storage::ReadStorage; use crate::terminal as term; -use crate::terminal::args; -use crate::terminal::{Args, Context, Help}; +use crate::terminal::Context; -pub const HELP: Help = Help { - name: "remote", - description: "Manage a repository's remotes", - version: env!("RADICLE_VERSION"), - usage: r#" -Usage +pub use args::Args; +pub(crate) use args::ABOUT; +use args::{Command, ListOption}; - rad remote [