summaryrefslogtreecommitdiffstats
path: root/ozone-cli
diff options
context:
space:
mode:
Diffstat (limited to 'ozone-cli')
-rw-r--r--ozone-cli/src/main.rs15
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...");