diff options
| author | mo8it <mo8it@proton.me> | 2024-07-08 12:53:44 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-08 12:53:44 +0200 |
| commit | a7a881809f462688b26ba7b81de85753c3507c22 (patch) | |
| tree | 5e6a541099becfd01f7a7d3325440b503b7ccc32 /src | |
| parent | 0f4cb94cfe31745e8fee9efc7dc1d287e65e16cb (diff) | |
Check is_terminal
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index a9f7b4a..3c96d1a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use anyhow::{bail, Context, Result}; use app_state::StateFileStatus; use clap::{Parser, Subcommand}; use std::{ - io::{self, BufRead, StdoutLock, Write}, + io::{self, BufRead, IsTerminal, StdoutLock, Write}, path::Path, process::exit, }; @@ -148,6 +148,10 @@ fn main() -> Result<()> { match args.command { None => { + if !io::stdout().is_terminal() { + bail!("Unsupported or missing terminal/TTY"); + } + let notify_exercise_names = if args.manual_run { None } else { |
