Skip to content

Commit

Permalink
Add another example to the tutorial
Browse files Browse the repository at this point in the history
Related to #7.
  • Loading branch information
volks73 committed Mar 24, 2021
1 parent f607667 commit 71951d9
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,14 +151,36 @@
//!
//! Note the single quotes around the output positional argument are needed
//! because of the exclamation mark, `!`, which needs to be escaped in most
//! shells.
//! shells. These examples demonstrate creating simple asciicast formatted
//! output from command line specified input and outputs but printing to stdout
//! is not very useful since the asciinema ecosystem uses asciicast files as
//! input and output. Thus, the previous two examples can be modified to save to
//! an asciicast file either using [redirection] or the `-o,--output-file` option.
//!
//! ```sh
//! ~$ germ "echo 'Hello, World!'" > example1.cast
//! ~$ germ -o example2.cast "echo 'Hello, world!'" "'Hello, World!'"
//! ~$ ls
//! example1.cast example2.cast
//! ~$
//! ```
//!
//! Both of the cast files created in the above example can be replayed using
//! the `asciinema play example1.cast` or `asciinema play example2.cast`
//! commands if the asciinema application is installed. The cast files can be
//! uploaded to [asciinema.org] using the `asciinema upload example1.cast` and
//! `asciinema upload example2.cast` commands. Currently, the asciinema
//! application does not accept input via stdin. The file extension does _not_
//! need to be `.cast`. Any file extension can be used, but `.cast` is the most
//! common for asciicast files.
//!
//! ["Hello, World!" program]: https://en.wikipedia.org/wiki/%22Hello,_World!%22_program
//! [`echo`]: https://en.wikipedia.org/wiki/Echo_(command)
//! [asciicast v2]: https://github.com/asciinema/asciinema/blob/develop/doc/asciicast-v2.md
//! [JSON]: https://en.wikipedia.org/wiki/JSON
//! [asciinema.org]: https://asciinema.org
//! [asciinema player]: https://github.com/asciinema/asciinema-player
//! [redirection]: https://en.wikipedia.org/wiki/Redirection_(computing)
use anyhow::Result;
use germ::Cli;
Expand Down

0 comments on commit 71951d9

Please sign in to comment.