I added a --shout flag that upper-cases the greeting. cargo test passes (15 tests), and cargo run -- --shout Ada prints HELLO, ADA!.
Options in src/lib.rs now has pub shout: bool. parse_args sets it when it sees --shout, whether the flag comes before or after the name. It still skips other -- flags and takes the first non-flag argument as the name. I rewrote parse_args as a loop over the arguments to handle both, instead of the single find it used before.
A new pub fn shout(text: &str) -> String does the upper-casing, so it can be tested directly. src/main.rs calls it on the greeting when the flag is set.
The new unit tests cover:
shoutdefaulting to false.--shoutbefore the name, after the name, and with no name.- The upper-casing itself.
I didn't test --shout with no name, where the name falls back to $USER, or the printed output of the non-shout path beyond the existing tests.