aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/ttyplay/main.rs')
-rw-r--r--src/bin/ttyplay/main.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/bin/ttyplay/main.rs b/src/bin/ttyplay/main.rs
index 699d329..d05ba5d 100644
--- a/src/bin/ttyplay/main.rs
+++ b/src/bin/ttyplay/main.rs
@@ -21,6 +21,9 @@ struct Opt {
#[structopt(short, long)]
paused: bool,
+
+ #[structopt(short, long, default_value = "4")]
+ speed: u32,
}
async fn async_main(opt: Opt) -> anyhow::Result<()> {
@@ -28,8 +31,11 @@ async fn async_main(opt: Opt) -> anyhow::Result<()> {
file,
clamp,
paused,
+ speed,
} = opt;
+ let speed = speed.clamp(0, 8);
+
let fh = async_std::fs::File::open(file).await?;
let mut input = textmode::Input::new().await?;
@@ -52,6 +58,7 @@ async fn async_main(opt: Opt) -> anyhow::Result<()> {
frame_data.clone(),
timer_r,
paused,
+ speed,
);
event::handle_events(event_r, timer_w.clone(), output, paused).await?;