blob: d16f1a38d0d720091276190f589f4dcb511c446f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
#![cfg_attr(not(test), warn(clippy::pedantic))]
#![cfg_attr(not(test), warn(clippy::expect_used))]
use anyhow::Result;
use clap::{Parser, Subcommand};
mod cli_interactor;
mod config;
mod key_handling;
mod login;
mod sub_commands;
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
#[command(propagate_version = true)]
pub struct Cli {
#[command(subcommand)]
command: Commands,
/// nsec or hex private key
#[arg(short, long)]
nsec: Option<String>,
}
#[derive(Subcommand)]
enum Commands {
/// save encrypted nsec for future use
Login(sub_commands::login::SubCommandArgs),
}
fn main() -> Result<()> {
let cli = Cli::parse();
match &cli.command {
Commands::Login(args) => sub_commands::login::launch(&cli, args),
}
}
|