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