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

Escape quote to force numbers as string doesn't seem to work in 1.9 #213

Open
jdimpson opened this issue Sep 17, 2024 · 3 comments
Open

Comments

@jdimpson
Copy link

The Bugs section of the Manual (jo.md) says this should work:

$ jo a=1.0
{"a":1}
$ jo a=\"1.0\"
{"a":"1.0"}

But when I run jo version 1.9 (from Debian 12 bookworm), I get this:

$ jo a=\"1.0\"
{"a":"\"1.0\""}
@jpmens
Copy link
Owner

jpmens commented Sep 17, 2024

At a glance it appears the string coercion option is missing; this works from my shell:

$ jo -- -s a="1.0"
{"a":"1.0"}

Indeed the escaped quotes produce unexpected results:

$ /bin/echo jo -- -s a=\"1.0\"
jo -- -s a="1.0"

$ jo -- -s a=\"1.0\"
{"a":"\"1.0\""}

@jdimpson
Copy link
Author

Ah, the jo -- -s ... syntax works for me as well, and will suit my purposes. I'm new to jo and hadn't understood the need for for the -- until now.

That said, the example I referred to under the Bugs section of the manual page is seemingly not accurate (unless I misunderstand something.)

Thank you for this wonderful tool. It complements jq very well!

@gromgit
Copy link
Collaborator

gromgit commented Sep 28, 2024

Indeed the escaped quotes produce unexpected results:

That seems to be because of 935a324

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