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

Display output as formatted JSON if --json is passed #5

Open
gammazero opened this issue May 2, 2023 · 3 comments
Open

Display output as formatted JSON if --json is passed #5

gammazero opened this issue May 2, 2023 · 3 comments

Comments

@gammazero
Copy link
Contributor

JSON allows for more structure than plain text, so it makes it much easier to output and handle complex data structures. The output of a number of commands have complex enough structure to benefit from this.

@masih
Copy link
Member

masih commented May 2, 2023

Suggestion: Use --output json instead.

@gammazero
Copy link
Contributor Author

gammazero commented May 2, 2023

I would prefer that --output not be used to designate output format, as that is commonly used to designate an output file in many commands. Examples:

  • sort: -o output, --output=output Print the output to the output file instead of the standard output.
  • wget: -o, --output-file=FILE log messages to FILE
  • curl: -o, --output <file> Write to file instead of stdout
  • gcc, go build, and many more use -o and --output to designate an output file as well.

So using --output to designate an output format, instead of an output file, is a break from this convention.

Maybe --format would accomplish the same goal?

@masih
Copy link
Member

masih commented May 23, 2023

--format works too 👍

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