Rollup merge of #82211 - henryboisdequin:make-setup-msgs-better, r=jyn514

make `suggest_setup` help messages better

When I first built the compiler and didn't create a `config.toml.example`, the following was emitted:

```
help: consider running `x.py setup` or copying `config.toml.example`
```

I ran `x.py setup` but got an error so in this PR I made the help messages a little clearer.
This commit is contained in:
Yuki Okushi 2021-02-18 15:57:30 +09:00 committed by GitHub
commit 9e60e7e379
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,10 @@ fn main() {
let suggest_setup = !config.config.exists() && !matches!(config.cmd, Subcommand::Setup { .. });
if suggest_setup {
println!("warning: you have not made a `config.toml`");
println!("help: consider running `x.py setup` or copying `config.toml.example`");
println!(
"help: consider running `./x.py setup` or copying `config.toml.example` by running \
`cp config.toml.example config.toml`"
);
} else if let Some(suggestion) = &changelog_suggestion {
println!("{}", suggestion);
}
@ -31,7 +34,10 @@ fn main() {
if suggest_setup {
println!("warning: you have not made a `config.toml`");
println!("help: consider running `x.py setup` or copying `config.toml.example`");
println!(
"help: consider running `./x.py setup` or copying `config.toml.example` by running \
`cp config.toml.example config.toml`"
);
} else if let Some(suggestion) = &changelog_suggestion {
println!("{}", suggestion);
}