I added a --lang option that takes en (the default), es or fr. cargo test passes, and the --lang es Ana | grep check passes. I didn't check the French output by hand; the new unit test covers it.
src/lib.rs:greeting(name, lang)now returnsResult<String, String>. It producesHello, {name}!,¡Hola, {name}!orBonjour, {name} !. The French greeting has a space before the!, as in the issue. An unknown language returns an error naming the supported ones, from a newLANGUAGESconstant. There are new unit tests for each language and for the error case.src/main.rs: it parses--lang <code>and--lang=<code>, and the name stays a positional argument. An unknown language printserror: unsupported language 'de' (supported: en, es, fr)to stderr and exits with status 2. A--langwith no value also exits with status 2.README.md: I added a short usage example for--lang.
greeting now takes a second argument, so any other caller of it needs updating. Within this repo only main.rs calls it.