Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: describe how to set a config value with apostrophes #5619

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

martinvonz
Copy link
Member

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

/// 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: triple quotes can be used in order to avoid closing/reopening shell quotes:

"'''don't'''"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That produces a different result in the TOML source. I don't like to give different examples for Bash and Fish that produce different results even if they represent the same string in the end. We could use the TOML triple quotes for both shells. Do you prefer that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I would rewrite both. The bash example is hard to parse without further explanation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've updated it to use the multi-line syntax and reworded a bit. PTAL

Apostrophes are not uncommon in e.g. `user.name`, so let's help the
user by providing examples.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants