diff --git a/crates/radicle-cli/examples/rad-auth-errors.md b/crates/radicle-cli/examples/rad-auth-errors.md index c723dec1..2fda97f5 100644 --- a/crates/radicle-cli/examples/rad-auth-errors.md +++ b/crates/radicle-cli/examples/rad-auth-errors.md @@ -1,17 +1,23 @@ Note that aliases must not be longer than 32 bytes, or you will get an error. There are other rules as well: -``` (fail) +``` (stderr) (fail) $ rad auth --alias "5fad63fe6b339fa92c588d926121bea6240773a7" -✗ Error: rad auth: alias cannot be greater than 32 bytes +error: invalid value '5fad63fe6b339fa92c588d926121bea6240773a7' for '--alias ': alias cannot be greater than 32 bytes + +For more information, try '--help'. ``` -``` (fail) +``` (stderr) (fail) $ rad auth --alias "john doe" -✗ Error: rad auth: alias cannot contain whitespace or control characters +error: invalid value 'john doe' for '--alias ': alias cannot contain whitespace or control characters + +For more information, try '--help'. ``` -``` (fail) +``` (stderr) (fail) $ rad auth --alias "" -✗ Error: rad auth: alias cannot be empty +error: invalid value '' for '--alias ': alias cannot be empty + +For more information, try '--help'. ``` diff --git a/crates/radicle-cli/src/commands/auth.rs b/crates/radicle-cli/src/commands/auth.rs index 1d9b0aa2..253c3b8e 100644 --- a/crates/radicle-cli/src/commands/auth.rs +++ b/crates/radicle-cli/src/commands/auth.rs @@ -1,5 +1,6 @@ #![allow(clippy::or_fun_call)] -use std::ffi::OsString; +mod args; + use std::str::FromStr; use anyhow::{anyhow, Context}; @@ -11,73 +12,18 @@ use radicle::profile::env; use radicle::{profile, Profile}; use crate::terminal as term; -use crate::terminal::args::{Args, Error, Help}; -pub const HELP: Help = Help { - name: "auth", - description: "Manage identities and profiles", - version: env!("RADICLE_VERSION"), - usage: r#" -Usage +pub use args::Args; +pub(crate) use args::ABOUT; - rad auth [