ok/jj
1
0
Fork 0
forked from mirrors/jj

cli: on config error, point to documentation

This commit is contained in:
Martin von Zweigbergk 2023-03-30 20:23:49 -07:00 committed by Martin von Zweigbergk
parent 3546cc1bf6
commit 5fe5991ca8
2 changed files with 5 additions and 0 deletions

View file

@ -2168,6 +2168,10 @@ pub fn handle_command_result(
}
Err(CommandError::ConfigError(message)) => {
writeln!(ui.error(), "Config error: {message}")?;
writeln!(
ui.hint(),
"For help, see https://github.com/martinvonz/jj/blob/main/docs/config.md."
)?;
Ok(ExitCode::from(1))
}
Err(CommandError::CliError(message)) => {

View file

@ -326,6 +326,7 @@ fn test_invalid_config() {
let stderr = test_env.jj_cmd_failure(test_env.env_root(), &["init", "repo"]);
insta::assert_snapshot!(stderr.replace('\\', "/"), @r###"
Config error: expected newline, found an identifier at line 1 column 10 in config/config0001.toml
For help, see https://github.com/martinvonz/jj/blob/main/docs/config.md.
"###);
}