hello/README.md

80 lines2,207 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. |
Document --lang in the README13| `--lang LANG` | Greets in the given language. Supported values are `en`, `es` and `fr`. Defaults to `en`. |
Add Usage section to README14
Greet people from the command line15```sh
16$ cargo run -- Ada
Merge #42: Greet with Hi instead of Hello17Hi, Ada!
Greet people from the command line18```
19
Document --shout, --version and --times in README usage20```sh
21$ cargo run -- --shout Ada
Merge #42: Greet with Hi instead of Hello22HI, ADA!
Document --shout, --version and --times in README usage23```
24
25```sh
26$ cargo run -- --times 2 Ada
Merge #42: Greet with Hi instead of Hello27Hi, Ada!
28Hi, Ada!
Document --shout, --version and --times in README usage29```
30
31```sh
Document --lang in the README32$ cargo run -- --lang es Ana
33¡Hola, Ana!
34```
35
36```sh
37$ cargo run -- --lang fr Luc
38Bonjour, Luc !
39```
40
41```sh
Document --shout, --version and --times in README usage42$ cargo run -- --version
430.1.0
44```
45
Greet people from the command line46With no name it greets whoever is signed in.
47
Show program output in README48## Output
49
50```sh
51$ cargo run -- Grace
Show Hi in README output example52Hi, Grace!
Show program output in README53```
54
Greet people from the command line55## Develop
56
Mention Rust edition in README Develop section57This project uses the Rust 2021 edition.
58
Greet people from the command line59```sh
60cargo test
61```
Merge main into main62
Add Troubleshooting section to README63## Troubleshooting
64
65**`error: --times value must be a number, got "abc"`**
66
67`--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`.
68
Merge #42: Greet with Hi instead of Hello69**The greeting says `Hi, world!` when I gave a name**
Add Troubleshooting section to README70
71An 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"`.
72
Document --lang in the README73**`error: --lang value must be one of en, es, fr, got "de"`**
74
75`--lang` only accepts `en`, `es` or `fr`. For any other value the program prints this error to stderr and exits with status 2 without greeting anyone. Pass one of the supported languages, for example `--lang es`.
76
Merge main into main77## License
78
79This project is licensed under the MIT License.
Link MIT license text from README License section80The 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.