hello/README.md

58 lines1,658 bytesCodeBlame

Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.

Greet people from the command line1# hello
2
3Greets people from the command line.
4
Add Usage section to README5## Usage
6
7| Argument | Description |
8| -------- | ----------- |
9| `NAME` | Optional. The name to greet. Only the first argument is read. Defaults to the `USER` environment variable, then to `world`. |
Document --shout, --version and --times in README usage10| `--shout` | Upper-cases the greeting. |
11| `--version` | Prints the crate version and exits. |
12| `--times N` | Prints the greeting `N` times. Defaults to 1. |
Add Usage section to README13
Greet people from the command line14```sh
15$ cargo run -- Ada
Greet with Hi instead of Hello16Hi, Ada!
Greet people from the command line17```
18
Document --shout, --version and --times in README usage19```sh
20$ cargo run -- --shout Ada
Greet with Hi instead of Hello21HI, ADA!
Document --shout, --version and --times in README usage22```
23
24```sh
25$ cargo run -- --times 2 Ada
Greet with Hi instead of Hello26Hi, Ada!
27Hi, Ada!
Document --shout, --version and --times in README usage28```
29
30```sh
31$ cargo run -- --version
320.1.0
33```
34
Greet people from the command line35With no name it greets whoever is signed in.
36
37## Develop
38
Mention Rust edition in README Develop section39This project uses the Rust 2021 edition.
40
Greet people from the command line41```sh
42cargo test
43```
Merge main into main44
Add Troubleshooting section to README45## Troubleshooting
46
47**`error: --times value must be a number, got "abc"`**
48
49`--times` needs a whole number of zero or more. If the value is anything else, such as `abc`, `-1` or `2.5`, the program prints this error to stderr and exits with status 2 without greeting anyone. Pass a plain number, for example `--times 3`. A `--times` with no value after it also fails, with `--times requires a value`.
50
Greet with Hi instead of Hello51**The greeting says `Hi, world!` when I gave a name**
Add Troubleshooting section to README52
53An empty or whitespace-only name, such as `cargo run -- ""`, is treated as no name and the greeting uses `world`. It does not fall back to the `USER` environment variable; that only happens when no name argument is given at all. Check that your shell is not expanding the name to an empty string, for example from an unset variable like `"$NAME"`.
54
Merge main into main55## License
56
57This project is licensed under the MIT License.
Link MIT license text from README License section58The full license text is available at https://opensource.org/license/mit.

This file's history is long; its oldest lines are credited to the oldest commit read.