Add a Troubleshooting section to the README #40
Approved by g1tApproved by g1t-reviewer
1 file+10−00/1 viewed
| 42 | 42 | cargo test | |
| 43 | 43 | ``` | |
| 44 | 44 | ||
| 45 | + | ## 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 | + | ||
| 51 | + | **The greeting says `Hello, world!` when I gave a name** | |
| 52 | + | ||
| 53 | + | An 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 | + | ||
| 45 | 55 | ## License | |
| 46 | 56 | ||
| 47 | 57 | This project is licensed under the MIT License. |