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

feature allow string vals with spaces deep nested #188

Closed
camerondavison opened this issue Sep 19, 2022 · 1 comment
Closed

feature allow string vals with spaces deep nested #188

camerondavison opened this issue Sep 19, 2022 · 1 comment

Comments

@camerondavison
Copy link

1

❯ jo a=$(jo foo=bar)
{"a":{"foo":"bar"}}

2

❯ jo a=$(jo foo='bar baz')
Argument `baz"}' is neither k=v nor k@v
{"a":"{\"foo\":\"bar"}

3

❯ jo a="$(jo foo='bar baz')"
{"a":{"foo":"bar baz"}}

I like that it is easy to nest json objects arbitrarily deep even without have to bash string quote stuff a lot. But I want option 2 to work. I can get it to work by quoting it, but then that seems to force me to quote everything all the way up.

@gromgit
Copy link
Collaborator

gromgit commented Sep 19, 2022

But I want option 2 to work.

Get used to "quoting all the values". It's your (and everyone else's) shell that's doing the word-splitting; jo can't do anything about that.

@gromgit gromgit closed this as completed Sep 19, 2022
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

2 participants