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

Don't fret about output format when the result data set is a raw array of unquoted strings #1616

Closed
mcandre opened this issue Mar 26, 2023 · 1 comment

Comments

@mcandre
Copy link

mcandre commented Mar 26, 2023

Please describe your feature request.

When the result data set is just a list of raw, unquoted strings, then yq could in practice go ahead and emit the output without terminating or warning about lack of TOML support.

Describe the solution you'd like

[target.aarch64-apple-darwin]
image = "freeznet/aarch64-apple-darwin-cross:11.3"

[target.x86_64-apple-darwin-cross]
image = "freeznet/x86_64-apple-darwin-cross:11.3"

And we run a command:

yq ".target | keys | .[] | . style=\"\"" Cross.toml

it could output

aarch64-apple-darwin
x86_64-apple-darwin-cross

instead of

Error: toml is not yet supported as an output format. Please specify another output format using the [--output-format/-o] flag

Describe alternatives you've considered

I tried working around this by specifying JSON as the output format. But that corrupted the output text by ignoring the blank quoting style.

As another workaround, I am using the "YAML" output format, even though the data set has no nested or ambiguously syntaxed elements, and even though the output text is not actually valid YAML.

@mikefarah
Copy link
Owner

Dupe of #1617 (afaik)

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

No branches or pull requests

2 participants