https://github.com/discobiscuit99/yaksay
Cowsay enhanced edition
https://github.com/discobiscuit99/yaksay
ascii cli
Last synced: over 1 year ago
JSON representation
Cowsay enhanced edition
- Host: GitHub
- URL: https://github.com/discobiscuit99/yaksay
- Owner: DiscoBiscuit99
- License: gpl-3.0
- Created: 2020-06-08T15:15:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-06-07T13:14:05.000Z (about 4 years ago)
- Last Synced: 2025-04-08T18:08:11.899Z (over 1 year ago)
- Topics: ascii, cli
- Language: Rust
- Homepage:
- Size: 1.84 MB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Yaksay – Cowsay enhanced
[](https://crates.io/crates/yaksay)
Just a small project to test out the Rust language.
To install the program, run `cargo install yaksay` in your terminal. If you haven't changed your cargo install directory, it will be installed to the `.cargo/bin/` folder.

Running the command `yaksay` in the terminal will spawn the default yak saying "Mooh!" as seen above. The program can of course also be run with a custom input string, like `yaksay "Hello, World!"`. This can be seen below. (Be aware that it might be required to prepend a backslash to exclamation marks and other special characters like so: '\\!'). It is possible to color the message differently by setting a color using the color flag, i.e., `yaksay -c green` will display the default message in green.

Running yaksay like so: `yaksay -w `, appending the `--width` flag, one is able to set the desired width (measured in characters) of the sentences before wrapping. If a sentence is not long enough to wrap at the desired length, the borders will shrink and snap to the text. The default width is 15 characters.
It is also possible to pass custom ascii to the program to be output instead of the default yak. This can be done with the command `yaksay -f path/to/ascii.*` (the asterics denoting that file type doesn't matter).
Keep in mind that there are essentially four states the yak can be in when printed, namely **happy** (default), **bored**, **surprised**, or **dead**. The yak cannot be in either one of these states at the same time and as of now, the program will pick among the given states and print an error message before the yak, informing the user that the yak collapsed to one of the given states (assuming it's a quantum yak).
To print helpful information, run the program with the `-h` flag. An extensive table of commands and related behavior can be found below.
## Command - Behavior table
| Flags and options | Behavior |
|--------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------|
| `` | Message from the yak (default: `Mooh!`). |
| `-h`, `--help` | Prints helpful information described in this table. |
| `-d`, `--dead` | Spawns a dead cow instead of the default live one. |
| `-b`, `--bored` | Spawns a bored cow instead of the default happy one. |
| `-s`, `--surprised` | Spawns a surprised cow instead of the default happy one. |
| `-i`, `--stdin` | Passes text from STDIN to the program (could be used like: `echo "Hello, World!" \| yaksay -i`). |
| `-V`, `--version` | Prints version information. |
| `--border-style ` | Sets the style of the border displaying the message (default: `fancy`). |
| `-c <color>`, `--color <color>` | Sets the color for the message to printed in (default: `yellow`). |
| `-w <number>`, `--width <number>` | Sets the wrapping width of the text in characters (default: `15`). |
| `-f <path/to/file.*>`, `--file <path/to/ascii.*>`| Prints custom ascii from file. The program reads the whole file to a string, so nothing but the ascii art should be in the file.|
## Features
+ [x] Sentence wrapping
+ [x] Abundance of expressions
+ [x] Display message in color
+ [x] Ability to load custom ascii
+ [x] Different border styles
+ [ ] More ascii-yaks to choose from
+ [ ] External storage of ascii-yaks
+ [ ] Implicitly read input from STDIN if detected
Ideas are welcomed with great enthusiasm!
## ASCII-credits
The default ascii art of the yak is assumedly a product of an "Ejm". Thank you Ejm, for yakifying the bison.