From beea99db3faea47dbd7c527da1d2f3151da3debe Mon Sep 17 00:00:00 2001 From: bigfoot547 Date: Wed, 12 Feb 2025 14:21:33 -0600 Subject: minecraft --- ozone-cli/src/cli.rs | 16 ++++++++++++++++ ozone-cli/src/main.rs | 13 +++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) (limited to 'ozone-cli/src') diff --git a/ozone-cli/src/cli.rs b/ozone-cli/src/cli.rs index d145e89..15a00da 100644 --- a/ozone-cli/src/cli.rs +++ b/ozone-cli/src/cli.rs @@ -160,6 +160,19 @@ impl InstanceArgs { } } +#[derive(Subcommand, Debug)] +pub enum AccountCommand { + Select, + Forget, + SignIn +} + +#[derive(Args, Debug)] +pub struct AccountArgs { + #[command(subcommand)] + pub command: AccountCommand +} + #[derive(Subcommand, Debug)] pub enum RootCommand { /// Manages instances. @@ -169,6 +182,9 @@ pub enum RootCommand { /// settings. Each instance runs the game in a separate directory. Instance(InstanceArgs), + /// Manages accounts. + Account(AccountArgs), + /// Launches the selected instance with the selected account. Launch } diff --git a/ozone-cli/src/main.rs b/ozone-cli/src/main.rs index 5174348..c53eade 100644 --- a/ozone-cli/src/main.rs +++ b/ozone-cli/src/main.rs @@ -7,8 +7,17 @@ use clap::Parser; use ozone::launcher::{Instance, JavaRuntimeSetting, Launcher, Settings}; use ozone::launcher::version::{VersionList, VersionResult}; use uuid::Uuid; +use ozone::auth::{Account, AuthenticationDatabase}; use crate::cli::{Cli, InstanceCommand, RootCommand}; +fn find_account(auth: &AuthenticationDatabase, input: &str) -> Option { + for user in auth.users.iter() { + + } + + todo!() +} + async fn main_inner(cli: Cli) -> Result> { let Some(home) = cli.home.or_else(Launcher::sensible_home) else { error!("Could not choose a launcher home directory. Please choose one with `--home'."); @@ -218,8 +227,4 @@ async fn main() -> ExitCode { ExitCode::FAILURE }) - - /*let launcher = Launcher::new("./work", true).await?; - - */ } -- cgit v1.2.3-70-g09d2