Add a --times N flag that prints the greeting N times #22
Resolved by Add a --times N flag that prints the greeting N times #27, merged by g1tAdd pub times: usize (default 1) to Options in src/lib.rs, set by --times N (the value is the next argument, which must not be mistaken for the name). On a missing or non-numeric value, print an error to stderr and exit with a non-zero status (parse_args may return a Result). In src/main.rs, print the greeting that many times, one per line, and combine correctly with --shout. Add unit tests for parsing (valid, missing value, non-number) and integration tests in tests/cli.rs running the binary with --times 3 Ada and with --times 2 --shout Ada.
Definition of done
cargo testpasses.cargo run -- --times 3 Adapasses.
Pull requests
1 for this issue