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

Embedded spaces not working. #166

Closed
dturanski opened this issue Feb 5, 2022 · 2 comments
Closed

Embedded spaces not working. #166

dturanski opened this issue Feb 5, 2022 · 2 comments
Labels

Comments

@dturanski
Copy link

Great tool, thanks! I ran into an issue trying to do this:

$ jo -p name=david address=$(jo street="101 Main St")
Argument `Main' is neither k=v nor k@v
Argument `St"}' is neither k=v nor k@v
{
   "name": "david",
   "address": "{\"street\":\"101"
}

Tried to escape the space, etc. but nothing worked.

This works as expected:

$ jo -p name=david address[street]="101 Main St"

Seems like there should be a way to make it work with the recursive style.

@jpmens
Copy link
Owner

jpmens commented Feb 5, 2022

It's not so much a recursive style issue than a shell quoting issue. I think you'll find this works:

$ jo -p name=david address="$(jo street="101 Main St")"
{
   "name": "david",
   "address": {
      "street": "101 Main St"
   }
}

@jpmens jpmens added the question label Feb 5, 2022
@dturanski
Copy link
Author

Too easy. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants