diff --git a/cli/src/commands/config/set.rs b/cli/src/commands/config/set.rs index 299506f62f..2176659187 100644 --- a/cli/src/commands/config/set.rs +++ b/cli/src/commands/config/set.rs @@ -38,8 +38,13 @@ pub struct ConfigSetArgs { /// New value to set /// /// The value should be specified as a TOML expression. If string value - /// doesn't contain any TOML constructs (such as array notation), quotes can - /// be omitted. + /// doesn't contain any TOML constructs (such as apostrophes or array + /// notation), quotes can be omitted. Note that the value may also need + /// shell quoting. The exact syntax depends on your shell. For example, + /// to set `foo.bar` to the string "don't" in Bash, use + /// `jj config set --user foo.bar '"don'\''t"'`. In Fish, use + /// `jj config set --user foo.bar '"don\'t"'`. Alternatively, use + /// `jj config edit` to edit the TOML file directly. #[arg(required = true, value_parser = parse_value_or_bare_string)] value: ConfigValue, #[command(flatten)] diff --git a/cli/tests/cli-reference@.md.snap b/cli/tests/cli-reference@.md.snap index 5791a09ec5..b9386116b3 100644 --- a/cli/tests/cli-reference@.md.snap +++ b/cli/tests/cli-reference@.md.snap @@ -642,7 +642,7 @@ Update config file to set the given option to a given value * `` * `` — New value to set - The value should be specified as a TOML expression. If string value doesn't contain any TOML constructs (such as array notation), quotes can be omitted. + The value should be specified as a TOML expression. If string value doesn't contain any TOML constructs (such as apostrophes or array notation), quotes can be omitted. Note that the value may also need shell quoting. The exact syntax depends on your shell. For example, to set `foo.bar` to the string "don't" in Bash, use `jj config set --user foo.bar '"don'\''t"'`. In Fish, use `jj config set --user foo.bar '"don\'t"'`. Alternatively, use `jj config edit` to edit the TOML file directly. ###### **Options:**