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

Remove quotations marks requirement for selectors #56

Closed
janaakhterov opened this issue Aug 11, 2020 · 3 comments
Closed

Remove quotations marks requirement for selectors #56

janaakhterov opened this issue Aug 11, 2020 · 3 comments

Comments

@janaakhterov
Copy link

Personally, I expect jq 'message' text.json to work, but I'm required to do jq '"message"' text.json instead which seems kinda pointless. Is this a potential feature/QoL improvement?

@yamafaktory
Copy link
Owner

I guess you mean jql not jq which is another tool :)

The reason is that people tend to forget about special characters in JSON https://github.com/yamafaktory/jql#special-characters

jq doesn't work out-of-the-box for those corner cases and you need to use some wizardry, see jqlang/jq#140. That's why jql does it like that, it always works, no matter what you inject but at the cost of having single quotes around.

I'm closing it as I have no plan to change the way it was designed.

@HenkPoley
Copy link

Anyways, on your benchmark page, the last jql item is not equivalent to jq due to the quotes requirement: https://github.com/yamafaktory/jql/blob/master/PERFORMANCE.md

@yamafaktory
Copy link
Owner

@HenkPoley good point! it should be echo '{ "foo": "bar" }' | jql '."foo"'... will fix!

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

No branches or pull requests

3 participants