From 74b17e5ffa9c19a62cdbc69e6b957483870f55da Mon Sep 17 00:00:00 2001 From: Jerod Santo Date: Thu, 5 Oct 2023 14:48:46 -0500 Subject: [PATCH] Improve docs around passing asciinema URL as input --- README.md | 6 ++++++ src/main.rs | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d77a75b..5091a3b 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,12 @@ agg demo.cast demo.gif The above command renders a GIF file with default theme (dracula), font size 14px. +You can also provide an asciinema.org URL as the first argument: + +```bash +agg https://asciinema.org/a/569727 starwars.gif +``` + Additional options are available for customization. For example, the following command selects Monokai theme, larger font size, 2x playback speed: diff --git a/src/main.rs b/src/main.rs index 3d44e03..1c6d503 100644 --- a/src/main.rs +++ b/src/main.rs @@ -48,7 +48,7 @@ impl clap::builder::TypedValueParser for ThemeValueParser { #[clap(author, version, about, long_about = None)] struct Cli { /// asciicast path/filename or URL - input_filename: String, + input_filename_or_url: String, /// GIF path/filename output_filename: String, @@ -180,7 +180,7 @@ fn main() -> Result<()> { show_progress_bar: true, }; - let input = BufReader::new(reader(&cli.input_filename)?); + let input = BufReader::new(reader(&cli.input_filename_or_url)?); let mut output = File::create(&cli.output_filename)?; agg::run(input, &mut output, config) }