diff options
Diffstat (limited to 'src/bin/ngit/main.rs')
| -rw-r--r-- | src/bin/ngit/main.rs | 26 |
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 | |||
| 5 | use anyhow::Result; | ||
| 6 | use clap::Parser; | ||
| 7 | use cli::{Cli, Commands}; | ||
| 8 | |||
| 9 | mod cli; | ||
| 10 | use ngit::*; | ||
| 11 | |||
| 12 | mod sub_commands; | ||
| 13 | |||
| 14 | #[tokio::main] | ||
| 15 | async 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 | } | ||