upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
new file mode 100644
index 0000000..d16f1a3
--- /dev/null
+++ b/src/main.rs
@@ -0,0 +1,35 @@
1#![cfg_attr(not(test), warn(clippy::pedantic))]
2#![cfg_attr(not(test), warn(clippy::expect_used))]
3
4use anyhow::Result;
5use clap::{Parser, Subcommand};
6
7mod cli_interactor;
8mod config;
9mod key_handling;
10mod login;
11mod sub_commands;
12
13#[derive(Parser)]
14#[command(author, version, about, long_about = None)]
15#[command(propagate_version = true)]
16pub struct Cli {
17 #[command(subcommand)]
18 command: Commands,
19 /// nsec or hex private key
20 #[arg(short, long)]
21 nsec: Option<String>,
22}
23
24#[derive(Subcommand)]
25enum Commands {
26 /// save encrypted nsec for future use
27 Login(sub_commands::login::SubCommandArgs),
28}
29
30fn main() -> Result<()> {
31 let cli = Cli::parse();
32 match &cli.command {
33 Commands::Login(args) => sub_commands::login::launch(&cli, args),
34 }
35}