data | ||
man | ||
src | ||
.gitignore | ||
Cargo.lock | ||
Cargo.toml | ||
LICENSE | ||
Makefile | ||
README.md |
Description
42 is a silly little utility similar in nature to the Unix fortune command of old, if it was much simpler and only provided Douglas Adams quotes primarily from the HitchHiker's guide.
History
The original 42 was written in C for HitchHiker Linux back when I was first learning how to program in that language. This rewrite in Rust preserves much of the simplicity of the original while being more robust and providing more flexibility in where it's data files are stored.
Installation
To build 42 you will need a Rust toolchain. The only explicit dependency besides
std
is the rand
crate, and the code is simple without much reliance on bleeding
edge features, so there should be some flexibility in what version of Rust is
used. The included Makefile
wraps the commands used and will install the data
files and Unix man pages into the proper locations. Should you wish to package
this little gem for your own distro (I'm not sure why, but maybe you would?) then
all of the files can be installed into a destdir by passing the DESTDIR
environment
variable to make install
.
make && make install
Usage
Most commonly you would call this program from your shell startup files by adding
42 &
to ~/.bashrc
or ~/.zshrc
, or whatever file your shell happens to use.
This will give you a DA quote every time you log in or open a new terminal window.