| |
The `unfollow` command takes a Node ID, optionally in DID format,
|
| |
and removes the follow policy for that peer."#;
|
| |
|
| - |
#[derive(Debug, Error)]
|
| - |
#[error("invalid Node ID specified (Node ID parsing failed with: '{nid}', DID parsing failed with: '{did}'))")]
|
| - |
struct NodeIdParseError {
|
| - |
did: radicle::identity::did::DidError,
|
| - |
nid: radicle::crypto::PublicKeyError,
|
| - |
}
|
| - |
|
| - |
fn parse_nid(value: &str) -> Result<NodeId, NodeIdParseError> {
|
| - |
value.parse::<Did>().map(NodeId::from).or_else(|did| {
|
| - |
value
|
| - |
.parse::<NodeId>()
|
| - |
.map_err(|nid| NodeIdParseError { nid, did })
|
| - |
})
|
| - |
}
|
| - |
|
| |
#[derive(Debug, Parser)]
|
| |
#[command(about = ABOUT, long_about = LONG_ABOUT, disable_version_flag = true)]
|
| |
pub struct Args {
|
| |
/// Node ID (optionally in DID format) of the peer to unfollow
|
| - |
#[arg(value_name = "NID", value_parser = parse_nid)]
|
| + |
#[arg(value_name = "NID", value_parser = args::parse_nid)]
|
| |
pub(super) nid: NodeId,
|
| |
|
| |
/// Verbose output
|