@@ -35,11 +35,12 @@ use self::repo::RepoSubcommands;
|
|||||||
use super::traits::CommandRunner;
|
use super::traits::CommandRunner;
|
||||||
use crate::error::{N34Error, N34Result};
|
use crate::error::{N34Error, N34Result};
|
||||||
|
|
||||||
|
// TODO: Make the `signer` group optional
|
||||||
/// The command-line interface options
|
/// The command-line interface options
|
||||||
#[derive(Args, Clone)]
|
#[derive(Args, Clone)]
|
||||||
#[clap(
|
#[clap(
|
||||||
group(
|
group(
|
||||||
ArgGroup::new("auth")
|
ArgGroup::new("signer")
|
||||||
.args(&["secret_key"])
|
.args(&["secret_key"])
|
||||||
.required(true)
|
.required(true)
|
||||||
)
|
)
|
||||||
@@ -92,6 +93,8 @@ impl CommandRunner for Commands {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO: Implement `ensure_signer` function with similar functionality to
|
||||||
|
// `ensure_relays`
|
||||||
impl CliOptions {
|
impl CliOptions {
|
||||||
/// Gets the public key of the user.
|
/// Gets the public key of the user.
|
||||||
pub async fn pubkey(&self) -> N34Result<PublicKey> {
|
pub async fn pubkey(&self) -> N34Result<PublicKey> {
|
||||||
|
|||||||
@@ -38,6 +38,8 @@ pub struct ViewArgs {
|
|||||||
|
|
||||||
impl CommandRunner for ViewArgs {
|
impl CommandRunner for ViewArgs {
|
||||||
async fn run(self, options: CliOptions) -> N34Result<()> {
|
async fn run(self, options: CliOptions) -> N34Result<()> {
|
||||||
|
// FIXME: The signer is not required here
|
||||||
|
|
||||||
let naddr = utils::naddr_or_file(self.naddr, &utils::nostr_address_path()?)?;
|
let naddr = utils::naddr_or_file(self.naddr, &utils::nostr_address_path()?)?;
|
||||||
let client = NostrClient::init(&options).await;
|
let client = NostrClient::init(&options).await;
|
||||||
client.add_relays(&naddr.relays).await;
|
client.add_relays(&naddr.relays).await;
|
||||||
|
|||||||
Reference in New Issue
Block a user