Skip to content

Commit

Permalink
Improve docs around passing asciinema URL as input
Browse files Browse the repository at this point in the history
  • Loading branch information
jerodsanto authored and ku1ik committed Oct 11, 2023
1 parent a9d9e44 commit 74b17e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
}

0 comments on commit 74b17e5

Please sign in to comment.