upleb.uk

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

summaryrefslogtreecommitdiff
path: root/src/bin/ngit/main.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-09-04 08:04:48 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-09-04 13:30:59 +0100
commit949c6459aa7683453a7160423b689ceadb08954b (patch)
tree230c26ecb11b99916e5570e548673eb09ecf0a36 /src/bin/ngit/main.rs
parenta825311f2c55661aaab3a163bda9109295c96044 (diff)
refactor: organise into lib and bin structure
the make the code more readable this commit just moves the files, the next commit should fix the imports
Diffstat (limited to 'src/bin/ngit/main.rs')
-rw-r--r--src/bin/ngit/main.rs26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs
new file mode 100644
index 0000000..97e5981
--- /dev/null
+++ b/src/bin/ngit/main.rs
@@ -0,0 +1,26 @@
1#![cfg_attr(not(test), warn(clippy::pedantic))]
2#![allow(clippy::large_futures)]
3#![cfg_attr(not(test), warn(clippy::expect_used))]
4
5use anyhow::Result;
6use clap::Parser;
7use cli::{Cli, Commands};
8
9mod cli;
10use ngit::*;
11
12mod sub_commands;
13
14#[tokio::main]
15async fn main() -> Result<()> {
16 let cli = Cli::parse();
17 match &cli.command {
18 Commands::Fetch(args) => sub_commands::fetch::launch(&cli, args).await,
19 Commands::Login(args) => sub_commands::login::launch(&cli, args).await,
20 Commands::Init(args) => sub_commands::init::launch(&cli, args).await,
21 Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await,
22 Commands::List => sub_commands::list::launch().await,
23 Commands::Pull => sub_commands::pull::launch().await,
24 Commands::Push(args) => sub_commands::push::launch(&cli, args).await,
25 }
26}