Fortune - but in rust
Find a file
2024-01-24 12:56:20 +08:00
src Add the GPL-3 License 2024-01-24 12:56:20 +08:00
.gitignore Allow multiple cookie files, add the -c parameter and improve error handling 2019-10-31 01:14:46 +01:00
.gitlab-ci.yml Remove fortunes file and install the fortunes package during ci 2019-10-31 01:23:09 +01:00
Cargo.lock Update to rust edition 2021 2024-01-24 11:44:06 +08:00
Cargo.toml Update to rust edition 2021 2024-01-24 11:44:06 +08:00
LICENSE Add the GPL-3 License 2024-01-24 12:56:20 +08:00
readme.md Update the readme with install instructions 2024-01-24 12:55:41 +08:00

Fortune-mod (in rust)

This is a clone of the original fortune command found on many unix systems

It's primarily an educational project in which i aim to completely reimplement the command.

Progress

  • Print a fortune from a fortunes file
  • Specify a cutoff for what is considered a short fortune (the -n flag)
  • Specify whether a short or a long fortune should be printed (the -l flag)
  • Wait n amount of seconds before the program exits (the -w flag)
  • Allow to filter with a pattern (the -m flag)
  • Ignore case for the pattern (the -i flag)
  • Allow multiple fortune cookie files
  • Implement the -f flag

Installing

Prerequisites:

  • rust
  • clang
  • pkg-config
  • openssl

Build:

cargo install https://github.com/runebaas/fortune-mod.rs.git 

Fortune files

Place your fortune files in one of the following locations:

  • *nix
    • /usr/share/fortune
    • /usr/share/games/fortunes
    • ./fortunes
  • windows
    • ./fortunes
    • ./cookies