diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-27 09:42:37 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-11-27 09:44:24 +0000 |
| commit | cb92d2ac8a7e014eac28ddf9ad1e6500b840739f (patch) | |
| tree | 15fc284c905a9ac636fada066ed3caa933ce562f /src/bin/ngit/main.rs | |
| parent | c002cef1e5d19946244086531f1178446fed8545 (diff) | |
feat(account): move login/out cmds to account
move login, logout export-keys commands to sub commands under account
Diffstat (limited to 'src/bin/ngit/main.rs')
| -rw-r--r-- | src/bin/ngit/main.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/bin/ngit/main.rs b/src/bin/ngit/main.rs index cdd0e97..a49267b 100644 --- a/src/bin/ngit/main.rs +++ b/src/bin/ngit/main.rs | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | use anyhow::Result; | 5 | use anyhow::Result; |
| 6 | use clap::Parser; | 6 | use clap::Parser; |
| 7 | use cli::{Cli, Commands}; | 7 | use cli::{AccountCommands, Cli, Commands}; |
| 8 | 8 | ||
| 9 | mod cli; | 9 | mod cli; |
| 10 | use ngit::{cli_interactor, client, git, git_events, login, repo_ref}; | 10 | use ngit::{cli_interactor, client, git, git_events, login, repo_ref}; |
| @@ -15,14 +15,16 @@ mod sub_commands; | |||
| 15 | async fn main() -> Result<()> { | 15 | async fn main() -> Result<()> { |
| 16 | let cli = Cli::parse(); | 16 | let cli = Cli::parse(); |
| 17 | match &cli.command { | 17 | match &cli.command { |
| 18 | Commands::Account(args) => match &args.account_command { | ||
| 19 | AccountCommands::Login(sub_args) => sub_commands::login::launch(&cli, sub_args).await, | ||
| 20 | AccountCommands::Logout => sub_commands::logout::launch().await, | ||
| 21 | AccountCommands::ExportKeys => sub_commands::export_keys::launch().await, | ||
| 22 | }, | ||
| 18 | Commands::Fetch(args) => sub_commands::fetch::launch(&cli, args).await, | 23 | Commands::Fetch(args) => sub_commands::fetch::launch(&cli, args).await, |
| 19 | Commands::Login(args) => sub_commands::login::launch(&cli, args).await, | ||
| 20 | Commands::Logout => sub_commands::logout::launch().await, | ||
| 21 | Commands::Init(args) => sub_commands::init::launch(&cli, args).await, | 24 | Commands::Init(args) => sub_commands::init::launch(&cli, args).await, |
| 22 | Commands::ExportKeys => sub_commands::export_keys::launch().await, | ||
| 23 | Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, | ||
| 24 | Commands::List => sub_commands::list::launch().await, | 25 | Commands::List => sub_commands::list::launch().await, |
| 25 | Commands::Pull => sub_commands::pull::launch().await, | 26 | Commands::Pull => sub_commands::pull::launch().await, |
| 26 | Commands::Push(args) => sub_commands::push::launch(&cli, args).await, | 27 | Commands::Push(args) => sub_commands::push::launch(&cli, args).await, |
| 28 | Commands::Send(args) => sub_commands::send::launch(&cli, args, false).await, | ||
| 27 | } | 29 | } |
| 28 | } | 30 | } |