feat: Enter repository as nip5

For example, `4rs.nl/n34` and `_@4rs.nl/n34`

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb
2025-05-24 11:00:37 +00:00
parent f7e837e3ab
commit de68d61c3f
4 changed files with 50 additions and 17 deletions

View File

@@ -28,10 +28,11 @@ use crate::{
/// Arguments for the `repo view` command
#[derive(Args, Debug)]
pub struct ViewArgs {
/// Repository address in `naddr` format.
/// Repository address in `naddr` format or `<nip5>/repo_id`. e.g.
/// `4rs.nl/n34` and `_@4rs.nl/n34`
///
/// If not provided, `n34` will look for a `nostr-address` file.
#[arg(short, long, value_parser = parsers::repo_naddr)]
/// If not provided, `n34` will look for the `nostr-address` file.
#[arg(value_name = "NADDR-OR-NIP05", long = "repo", value_parser = parsers::repo_naddr)]
naddr: Option<Nip19Coordinate>,
}