aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/ttyplay/main.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2023-03-08 13:32:39 -0500
committerJesse Luehrs <doy@tozt.net>2023-03-08 13:32:39 -0500
commit9b1d7a190b8f660c5db77cc311a5c613990cdef5 (patch)
treea3e14c2bb9d855fe9cf275951ce63a130fe5663f /src/bin/ttyplay/main.rs
parent2f970a5daf50796aaab4d93a2a84e0f293809ac0 (diff)
downloadttyrec-bin-9b1d7a190b8f660c5db77cc311a5c613990cdef5.tar.gz
ttyrec-bin-9b1d7a190b8f660c5db77cc311a5c613990cdef5.zip
bump deps
Diffstat (limited to 'src/bin/ttyplay/main.rs')
-rw-r--r--src/bin/ttyplay/main.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/bin/ttyplay/main.rs b/src/bin/ttyplay/main.rs
index 832b870..0cf7427 100644
--- a/src/bin/ttyplay/main.rs
+++ b/src/bin/ttyplay/main.rs
@@ -11,14 +11,16 @@
#![allow(clippy::too_many_lines)]
#![allow(clippy::type_complexity)]
+use clap::Parser as _;
+
mod display;
mod event;
mod frames;
mod input;
mod timer;
-#[derive(Debug, structopt::StructOpt)]
-#[structopt(
+#[derive(Debug, clap::Parser)]
+#[command(
name = "ttyplay",
about = "Plays back ttyrec files",
long_about = "\n\
@@ -29,7 +31,7 @@ mod timer;
paused."
)]
struct Opt {
- #[structopt(
+ #[arg(
short,
long,
default_value = "ttyrec",
@@ -37,16 +39,16 @@ struct Opt {
)]
file: std::ffi::OsString,
- #[structopt(
+ #[arg(
long,
help = "Restrict time between frames to at most this many milliseconds"
)]
clamp: Option<u64>,
- #[structopt(short, long, help = "Start the player paused")]
+ #[arg(short, long, help = "Start the player paused")]
paused: bool,
- #[structopt(
+ #[arg(
short,
long,
default_value = "4",
@@ -100,8 +102,8 @@ async fn async_main(opt: Opt) -> anyhow::Result<()> {
Ok(())
}
-#[paw::main]
-fn main(opt: Opt) {
+fn main() {
+ let opt = Opt::parse();
match async_main(opt) {
Ok(_) => (),
Err(e) => {