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

--indent 0 omits more than indentations #2498

Open
zstadler opened this issue Nov 4, 2022 · 1 comment
Open

--indent 0 omits more than indentations #2498

zstadler opened this issue Nov 4, 2022 · 1 comment

Comments

@zstadler
Copy link
Contributor

zstadler commented Nov 4, 2022

Describe the bug

jq --indent 0 behaves like jq --compact-output rather than only omit the indentations.

To Reproduce

jq --indent 0 -n "[1,2]" produces

[1,2]

Expected behavior

I would expect jq --indent 0 to keep lines separated and only avoid adding the indentations.

For example, jq --indent 0 -n "[1,2]" should produce

[
1,
2
]

In other words, jq --indent 0 ... should be equivalent to jq ... | sed 's/^\s*//' on Linux.

Environment:

  • OS and Version: Windows, Linux - WSL
  • jq version 1.6
@itchyny
Copy link
Contributor

itchyny commented Nov 4, 2022

Duplication of #1465.

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