lear

Crates.iolear
lib.rslear
version0.2.0
sourcesrc
created_at2021-10-09 02:17:02.369708
updated_at2021-10-09 21:46:09.415642
descriptionPrints a random passage from King Lear. For when you meant to type "clear"
homepagehttps://github.com/kyle-silver/lear
repositoryhttps://github.com/kyle-silver/lear
max_upload_size
id462619
size1,700,909
Kyle Silver (kyle-silver)

documentation

README

Lear: A Shakespearean Command Line Utility

Lear is a command line “utility” that you can use to amuse yourself and your friends. Whenever you mistype clear into the terminal, lear will dutifully print out a passage from everyone’s favorite tragedy about a mad king.

This idea was loosely inspired by sl (Steam Locomotive), Fortune, and all of the other weird command line scripts out there.

Usage

To get started, type lear into the console (preferably by accident).

a demonstration of lear, with a passage from act 3 scene 2 printed to the console

To print a specific passage, use the quote subcommand. It accepts the act, scene, starting line, and ending line as positional arguments. This example quotes lines 7–8 from Act 3, Scene 3.

$ lear quote 3 3 7 8
EDMUND
    Most savage and unnatural!

GLOUCESTER
    Go to; say you nothing. There's a division betwixt
    ...

                                                            (Lr. 3.3.7-8)

You can use the contents command to print a table of contents, which will show you which acts and scenes are available, as well as how many lines they contain.

$ lear contents
 Act  Scene  Lines
-------------------
  1     1     332
        2     191
        3     27
...

Installation

If you have cargo installed on your machine already, lear can be installed with

$ cargo install lear

A homebrew installation is hopefully coming soon.

Contributing

If you would like to contribute to this tool, please open an issue or submit a pull request

Commit count: 26

cargo fmt