Convert 'sl" Source Code from C to Rust

Intro

This tutorial is using Debian, v. 11.x, AKA Bullseye.

What we're doing:

The "sl" app found in Debian is just a "useless" (the sl's author's word, not mine) little app. It "trains" you to not misspell "ls" as "sl" by "punishing" you with an ASCII-art train that choo-choos its way across your terminal window. Written in the C programming language, it seemed the perfect little app to convert into Rust.

To see it in action, just install it with this command, typed in a terminal window by a sudo-capable user:

$ sudo apt update
$ sudo apt install sl

And then run it with a simple:

$ sl

Whoo-hoo! Er, I mean, "Whoo-whoo!"

You can even throw some options to the program, such as:

$ sl -F

which causes the train to "F"ly.

or:

$ sl -a

which results in an apparent "a"ccident.

or:

$ sl -l

which draws a "l"ittle train instead of the standard D51 train.

To see the man page ("manual") for "sl", just:

$ man sl

What we'll be doing is converting the human-readable source code for this program from the C programming language to the Rust programming language. To continue, we'll need to make sure that we have a working Rust environment on your Debian box. We'll do this in the next lesson, Establish a Working Rust Environment.