summaryrefslogtreecommitdiffstats
path: root/src/bin/client/main.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/bin/client/main.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bin/client/main.rs b/src/bin/client/main.rs
index 1b701d8..9018026 100644
--- a/src/bin/client/main.rs
+++ b/src/bin/client/main.rs
@@ -10,6 +10,21 @@ fn main() {
10 let args: Vec<String> = std::env::args().collect(); 10 let args: Vec<String> = std::env::args().collect();
11 let unsafe_mode = args.iter().any(|arg| arg == "--unsafe"); 11 let unsafe_mode = args.iter().any(|arg| arg == "--unsafe");
12 12
13 // Every game board is drawn in place, so refuse a terminal that cannot fit
14 // them before touching the network or the terminal mode.
15 let size = crossterm::terminal::size();
16 let (columns, rows) = match &size {
17 Ok((columns, rows)) => (*columns, *rows),
18 Err(_) => (0, 0),
19 };
20 if let Some(message) = zagan_bet::client::ui::terminal_too_small(columns, rows) {
21 eprintln!("{message}");
22 if size.is_err() {
23 eprintln!("Could not read the terminal size (is this a real terminal?).");
24 }
25 std::process::exit(1);
26 }
27
13 if unsafe_mode { 28 if unsafe_mode {
14 println!("WARNING: Running in UNSAFE mode - certificate verification disabled!"); 29 println!("WARNING: Running in UNSAFE mode - certificate verification disabled!");
15 } 30 }