From c1d9f0496370e90ee3a300aa96dcf21149543779 Mon Sep 17 00:00:00 2001 From: Sebastian Martinez Date: Fri, 17 Oct 2025 14:41:53 +0200 Subject: [PATCH] cli/self: Use clap --- crates/radicle-cli/src/commands/help.rs | 5 +- crates/radicle-cli/src/commands/self.rs | 144 ++++--------------- crates/radicle-cli/src/commands/self/args.rs | 30 ++++ crates/radicle-cli/src/main.rs | 10 +- 4 files changed, 67 insertions(+), 122 deletions(-) create mode 100644 crates/radicle-cli/src/commands/self/args.rs diff --git a/crates/radicle-cli/src/commands/help.rs b/crates/radicle-cli/src/commands/help.rs index 873535b4..fee59faa 100644 --- a/crates/radicle-cli/src/commands/help.rs +++ b/crates/radicle-cli/src/commands/help.rs @@ -95,7 +95,10 @@ const COMMANDS: &[CommandItem] = &[ name: "clean", about: crate::commands::clean::ABOUT, }, - CommandItem::Lexopt(crate::commands::rad_self::HELP), + CommandItem::Clap { + name: "self", + about: crate::commands::rad_self::ABOUT, + }, CommandItem::Clap { name: "seed", about: crate::commands::seed::ABOUT, diff --git a/crates/radicle-cli/src/commands/self.rs b/crates/radicle-cli/src/commands/self.rs index 04cb11f6..bf587c1e 100644 --- a/crates/radicle-cli/src/commands/self.rs +++ b/crates/radicle-cli/src/commands/self.rs @@ -1,129 +1,41 @@ -use std::ffi::OsString; +#[path = "self/args.rs"] +mod args; + +pub use args::Args; +pub(crate) use args::ABOUT; use radicle::crypto::ssh; use radicle::node::Handle as _; use radicle::{Node, Profile}; use crate::terminal as term; -use crate::terminal::args::{Args, Error, Help}; use crate::terminal::Element as _; -pub const HELP: Help = Help { - name: "self", - description: "Show information about your identity and device", - version: env!("RADICLE_VERSION"), - usage: r#" -Usage - - rad self [