From 72ec0775c7fab75a5fe8d634e20ae11a73b5d309 Mon Sep 17 00:00:00 2001 From: xphoniex Date: Thu, 10 Nov 2022 15:19:48 +0000 Subject: [PATCH] Add `rad-edit` command Signed-off-by: xphoniex --- radicle-cli/src/commands.rs | 2 + radicle-cli/src/commands/edit.rs | 99 ++++++++++++++++++++++++++++++++ radicle-cli/src/commands/help.rs | 1 + radicle-cli/src/main.rs | 8 +++ 4 files changed, 110 insertions(+) create mode 100644 radicle-cli/src/commands/edit.rs diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs index 6e5d16ba..abd1bc6e 100644 --- a/radicle-cli/src/commands.rs +++ b/radicle-cli/src/commands.rs @@ -4,6 +4,8 @@ pub mod rad_auth; pub mod rad_checkout; #[path = "commands/clone.rs"] pub mod rad_clone; +#[path = "commands/edit.rs"] +pub mod rad_edit; #[path = "commands/help.rs"] pub mod rad_help; #[path = "commands/init.rs"] diff --git a/radicle-cli/src/commands/edit.rs b/radicle-cli/src/commands/edit.rs new file mode 100644 index 00000000..88ebae29 --- /dev/null +++ b/radicle-cli/src/commands/edit.rs @@ -0,0 +1,99 @@ +use std::ffi::OsString; +use std::str::FromStr; + +use anyhow::{anyhow, Context as _}; + +use radicle::identity::Id; +use radicle::storage::{ReadStorage, WriteStorage}; + +use crate::terminal as term; +use crate::terminal::args::{Args, Error, Help}; + +pub const HELP: Help = Help { + name: "edit", + description: "Edit a radicle identity doc", + version: env!("CARGO_PKG_VERSION"), + usage: r#" +Usage + + rad edit [] [