Other work is changing the same files
Whichever merges second will have to catch up, and may conflict.
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 returns Result<String, String>. It produces Hello, {name}!, ¡Hola, {name}! or Bonjour, {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 new LANGUAGES constant. 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 prints error: unsupported language 'de' (supported: en, es, fr) to stderr and exits with status 2. A --lang with 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.
Sign in to comment.