diff options
author | Jesse Luehrs <doy@tozt.net> | 2023-03-08 13:32:39 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2023-03-08 13:32:39 -0500 |
commit | 9b1d7a190b8f660c5db77cc311a5c613990cdef5 (patch) | |
tree | a3e14c2bb9d855fe9cf275951ce63a130fe5663f /src/bin/ttyrec/main.rs | |
parent | 2f970a5daf50796aaab4d93a2a84e0f293809ac0 (diff) | |
download | ttyrec-bin-9b1d7a190b8f660c5db77cc311a5c613990cdef5.tar.gz ttyrec-bin-9b1d7a190b8f660c5db77cc311a5c613990cdef5.zip |
bump deps
Diffstat (limited to 'src/bin/ttyrec/main.rs')
-rw-r--r-- | src/bin/ttyrec/main.rs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/bin/ttyrec/main.rs b/src/bin/ttyrec/main.rs index 1dbba54..1a3c03d 100644 --- a/src/bin/ttyrec/main.rs +++ b/src/bin/ttyrec/main.rs @@ -11,10 +11,11 @@ #![allow(clippy::too_many_lines)] #![allow(clippy::type_complexity)] +use clap::Parser as _; use tokio::io::{AsyncReadExt as _, AsyncWriteExt as _}; -#[derive(Debug, structopt::StructOpt)] -#[structopt( +#[derive(Debug, clap::Parser)] +#[command( name = "ttyrec", about = "Records ttyrec files", long_about = "\n\ @@ -23,7 +24,7 @@ use tokio::io::{AsyncReadExt as _, AsyncWriteExt as _}; for later playback (such as via the included `ttyplay` command)." )] struct Opt { - #[structopt( + #[arg( short, long, default_value = "ttyrec", @@ -31,7 +32,7 @@ struct Opt { )] file: std::ffi::OsString, - #[structopt(short, long, help = "Command to run [default: $SHELL]")] + #[arg(short, long, help = "Command to run [default: $SHELL]")] cmd: Option<std::ffi::OsString>, } @@ -206,8 +207,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) => { |