diff options
Diffstat (limited to 'ozone-cli/src/main.rs')
| -rw-r--r-- | ozone-cli/src/main.rs | 37 |
1 files changed, 22 insertions, 15 deletions
diff --git a/ozone-cli/src/main.rs b/ozone-cli/src/main.rs index d0d7b21..346532a 100644 --- a/ozone-cli/src/main.rs +++ b/ozone-cli/src/main.rs @@ -16,15 +16,32 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> { info!("Sensible home could be {home:?}"); let settings = Settings::load(home.join("ozone.json")).await?; - settings.save().await?; - match cli.subcmd { - RootCommand::Profile(mut p) => match p.take_command() { + match &cli.subcmd { + RootCommand::Profile(p) => match p.command() { ProfileCommand::List => { - todo!() + for (name, profile) in settings.get_profiles().iter() { + println!("{name}: {profile:#?}"); + } } _ => todo!() }, + RootCommand::Launch => { + settings.save().await?; + + let launcher = Launcher::new(&home, !cli.offline).await?; + let profile = settings.get_profiles().get("default").unwrap(); + + let launch = launcher.prepare_launch(profile, settings.get_instances().get(profile.get_instance_name()).unwrap(), settings.get_client_id()).await.map_err(|e| { + error!("error launching: {e}"); + e + })?; + + dbg!(&launch); + info!("ok"); + + ozone::launcher::run_the_game(&launch)?; + } _ => todo!() } @@ -46,15 +63,5 @@ async fn main() -> ExitCode { /*let launcher = Launcher::new("./work", true).await?; - let profile = settings.get_profile("default").unwrap(); - - let launch = launcher.prepare_launch(profile, settings.get_instance_for(profile)).await.map_err(|e| { - error!("error launching: {e}"); - e - })?; - - dbg!(&launch); - info!("ok"); - - ozone::launcher::run_the_game(&launch)?;*/ + */ } |
