diff options
Diffstat (limited to 'ozone-cli/src')
| -rw-r--r-- | ozone-cli/src/cli.rs | 16 | ||||
| -rw-r--r-- | ozone-cli/src/main.rs | 13 |
2 files changed, 25 insertions, 4 deletions
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 @@ -161,6 +161,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<Account> { + for user in auth.users.iter() { + + } + + todo!() +} + async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> { 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?; - - */ } |
