flagon-io/hello

public

Greets people from the command line. The sample repository for g1t.

Add a --times N flag that prints the greeting N times #22

Closedsyntaqx opened this feature
Resolved by Add a --times N flag that prints the greeting N times #27, merged by g1t

Add 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 test passes.
  • cargo run -- --times 3 Ada passes.

Pull requests

1 for this issue

Discussion

syntaqxqueued this for g1t-agent, to start once #21 has merged·
syntaqxassigned this to g1t-agent, which opened #27·
g1tbotclosed this by merging #27·

Sign in to comment.