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

Provide the detailed usage example in Readme.md #15

Open
Hariharnath-Paduchuru opened this issue Oct 14, 2020 · 2 comments
Open

Provide the detailed usage example in Readme.md #15

Hariharnath-Paduchuru opened this issue Oct 14, 2020 · 2 comments

Comments

@Hariharnath-Paduchuru
Copy link

I am using the latest release to convert json to toml.

./yj -jj redis.json

But I am getting the error as follows
Error: invalid flags specified: d s . s o

Please provide an example to convert from json file to toml file

@sclevine
Copy link
Owner

Thanks for the suggestion!

As mentioned in the help text in the README, yj operates on stdin. So to convert redis.json to TOML, you might invoke it like:

./yj -jt < redis.json

Or:

cat redis.json | ./yj -jt

I'll add an example to the README when I get a chance.

@raylinz1
Copy link

raylinz1 commented Jul 2, 2021

I'm a windows user and in Powershell it looked like: (I was doing a yaml to HCL conversion)
gc <filename> | .\yj.exe -yc

Unfortunately this did not work for my purposes. I was trying convert a custom resource definition yaml file for kuberenetes into an output that could be used for the "hashicorp/kubernetes" provider resource "kubernetes_deployment" in terraform. The formatting was not accepted for a few reasons that I tried to update through replacement after the fact. It doesn't want to accept quoted names in name value pairs nor does it want to have properties repeated with every property. It wants to see properties = [array of properties].

intermezzio added a commit to intermezzio/yj that referenced this issue Apr 5, 2022
Powershell instructions will be different, and should be added too, but this should help clarify the use case as described in sclevine#15
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