From d9611e009279eeb74d642f72adab9621577b33c8 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 5 Dec 2021 19:29:07 -0500 Subject: fill out help output --- src/bin/ttyplay/main.rs | 33 ++++++++++++++++++++++++++++----- src/bin/ttyrec/main.rs | 19 ++++++++++++++++--- 2 files changed, 44 insertions(+), 8 deletions(-) diff --git a/src/bin/ttyplay/main.rs b/src/bin/ttyplay/main.rs index e295932..c1cebc9 100644 --- a/src/bin/ttyplay/main.rs +++ b/src/bin/ttyplay/main.rs @@ -11,18 +11,41 @@ mod input; mod timer; #[derive(Debug, structopt::StructOpt)] -#[structopt(about = "ttyplay")] +#[structopt( + name = "ttyplay", + about = "Plays back ttyrec files", + long_about = "\n\ + This is a player for ttyrec files. It allows arbitrary seeking, both \ + forward and backward, as well as searching through the file for \ + output. Playback can be paused using the Space key, and the rest of \ + the key bindings can be found by pressing `?` while the player is \ + paused." +)] struct Opt { - #[structopt(short, long, default_value = "ttyrec")] + #[structopt( + short, + long, + default_value = "ttyrec", + help = "File to read ttyrec data from" + )] file: std::ffi::OsString, - #[structopt(long)] + #[structopt( + long, + help = "Restrict time between frames to at most this many milliseconds" + )] clamp: Option, - #[structopt(short, long)] + #[structopt(short, long, help = "Start the player paused")] paused: bool, - #[structopt(short, long, default_value = "4")] + #[structopt( + short, + long, + default_value = "4", + help = "Speed to run the playback at. This can be a number from 0-8, \ + where higher is faster." + )] speed: u32, } diff --git a/src/bin/ttyrec/main.rs b/src/bin/ttyrec/main.rs index a6ccdf4..61835b5 100644 --- a/src/bin/ttyrec/main.rs +++ b/src/bin/ttyrec/main.rs @@ -8,11 +8,24 @@ use async_std::stream::StreamExt as _; use pty_process::Command as _; #[derive(Debug, structopt::StructOpt)] -#[structopt(about = "ttyrec")] +#[structopt( + name = "ttyrec", + about = "Records ttyrec files", + long_about = "\n\ + This program will run a shell (or other program specified by the -c \ + option), and record the full output, including timing information, \ + for later playback (such as via the included `ttyplay` command)." +)] struct Opt { - #[structopt(short, long, default_value = "ttyrec")] + #[structopt( + short, + long, + default_value = "ttyrec", + help = "File to save ttyrec data to" + )] file: std::ffi::OsString, - #[structopt(short, long)] + + #[structopt(short, long, help = "Command to run [default: $SHELL]")] cmd: Option, } -- cgit v1.2.3-54-g00ecf