diff --git a/CHANGELOG.md b/CHANGELOG.md index a2f4a2c..175caa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## 🎯 [Unreleased] +### Added +- Quiet (-q|--quiet) mode to suppress Ctrl+D banner: 'Press Ctrl+D to end recording' [pull/39] ## [0.4.2] - 2021-01-04 ### Added @@ -108,4 +110,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Generating a gif out of n frames of a recording - CI pipeline as GitHub Actions workflow -[issue/4]: https://github.com/sassman/t-rec-rs/issues/4 \ No newline at end of file +[issue/4]: https://github.com/sassman/t-rec-rs/issues/4 diff --git a/src/cli.rs b/src/cli.rs index 95af31c..2fdf1c5 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -14,6 +14,13 @@ pub fn launch<'a>() -> ArgMatches<'a> { .required(false) .help("Enable verbose insights for the curious.") ) + .arg(Arg::with_name("quiet") + .takes_value(false) + .short("q") + .long("quiet") + .required(false) + .help("Quiet mode, suppresses the banner: 'Press Ctrl+D to end recording'") + ) .arg( Arg::with_name("decor") .takes_value(true) diff --git a/src/main.rs b/src/main.rs index 13c757e..6313109 100644 --- a/src/main.rs +++ b/src/main.rs @@ -105,7 +105,11 @@ fn main() -> Result<()> { println!("Recording window id: {}", win_id); } } - println!("Press Ctrl+D to end recording"); + if args.is_present("quiet") { + println!(); + } else { + println!("Press Ctrl+D to end recording"); + } thread::sleep(Duration::from_millis(1250)); clear_screen();