Print a random, hopefully interesting, adage.
GoFortune is a Go implementation of the classic Unix fortune and strfile utilities. It aims for compatibility with the fortune-mod 1.0 storage format.
You can install GoFortune using go install:
go install github.com/vromero/gofortune@latestPrint a random adage:
gofortuneUseful flags:
-sshort fortunes only,-llong only,-n Nthreshold (default 160)-m PATTERNprint all fortunes matching a regular expression,-icase-insensitive-opick from offensive fortunes only,-aall maxims-cshow the cookie file a fortune came from-fprint the list of candidate files and their probabilities-eweight every file equally regardless of size-wpause after printing, scaling with the length of the fortune
Provide one or more paths (optionally preceded by N% to weight them) to
override the default /usr/share/games/fortunes location:
gofortune 30% /path/to/my/fortunes 70% /path/to/other/fortunesCreate a random access index file for storing strings:
gofortune strfile <source_file> [data_file]Example:
# Create an index from fortunes.txt and save it as fortunes.txt.dat
gofortune strfile fortunes.txtGoFortune supports multiple languages. When the LANG environment variable is set, the tool will attempt to find fortunes in the corresponding directory (e.g., /usr/share/games/fortunes/es).
This project adheres to the Contributor Covenant code of conduct. Please refer to our contributing guidelines for more information.
