From 9feffa54c8ff936db58fe18e6cf46a44b1b5e8d9 Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Tue, 6 Feb 2024 09:17:12 -0800 Subject: [PATCH] cli: include command to set config in hint about default command When the user doesn't have a configured default command, we show a hint saying to set `ui.default-command`. I think the user is very likely to want to set that in the user-wide config, so let's include the command in the hint. --- cli/src/cli_util.rs | 2 +- cli/tests/test_global_opts.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/cli_util.rs b/cli/src/cli_util.rs index 603b50b9f..f3c0b3637 100644 --- a/cli/src/cli_util.rs +++ b/cli/src/cli_util.rs @@ -2688,7 +2688,7 @@ fn resolve_default_command( )?; writeln!( ui.hint(), - "Set the config `ui.default-command = \"log\"` to disable this message." + "Run `jj config set --user ui.default-command log` to disable this message." )?; } let default_command = config diff --git a/cli/tests/test_global_opts.rs b/cli/tests/test_global_opts.rs index 8e4562290..1d0ab065a 100644 --- a/cli/tests/test_global_opts.rs +++ b/cli/tests/test_global_opts.rs @@ -68,7 +68,7 @@ fn test_no_subcommand() { let stderr = test_env.jj_cmd_failure(test_env.env_root(), &[]); insta::assert_snapshot!(stderr, @r###" Hint: Use `jj -h` for a list of available commands. - Set the config `ui.default-command = "log"` to disable this message. + Run `jj config set --user ui.default-command log` to disable this message. Error: There is no jj repo in "." "###);