diff options
| author | 2025-02-17 01:25:49 -0600 | |
|---|---|---|
| committer | 2025-02-17 01:25:49 -0600 | |
| commit | a7f27a721ddcd0d3fc9c148f22cd5cb567b71d1a (patch) | |
| tree | 142441f6b2f6f77e593e8af7443b08bb05f29ee9 /ozone-cli/src | |
| parent | wip: launch game with auth (diff) | |
random changes
Diffstat (limited to 'ozone-cli/src')
| -rw-r--r-- | ozone-cli/src/main.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/ozone-cli/src/main.rs b/ozone-cli/src/main.rs index d383cb7..81a44f9 100644 --- a/ozone-cli/src/main.rs +++ b/ozone-cli/src/main.rs @@ -300,6 +300,11 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> { accounts.save(&accounts_path).await?; }, AccountCommand::SignIn(args) => { + if cli.offline { + eprintln!("This command cannot be used while offline."); + return Ok(ExitCode::FAILURE); + } + let (client_id, azure) = if args.use_alt_client_id { (ALT_CLIENT_ID, false) } else { @@ -386,6 +391,11 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> { display_account(account, false, true); }, AccountCommand::Refresh => { + if cli.offline { + eprintln!("This command cannot be used while offline."); + return Ok(ExitCode::FAILURE); + } + let Some(account) = accounts.get_selected_account_mut() else { eprintln!("No account selected."); return Ok(ExitCode::FAILURE); @@ -424,8 +434,8 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> { return Ok(ExitCode::FAILURE); }; - match account { - Account::MSA(msa_acct) => { + if !cli.offline { + if let Account::MSA(msa_acct) = account { let client = MsaAccount::create_client(); println!("Looking up account information..."); @@ -444,7 +454,6 @@ async fn main_inner(cli: Cli) -> Result<ExitCode, Box<dyn Error>> { accounts.save(&accounts_path).await?; } - _ => () // nothing to be done } println!("Preparing the game files..."); |
