Skip to content

Colorize jq output #17

@steve-r-west

Description

@steve-r-west

Webster's dictionary defines beauty as "the quality or aggregate of qualities in a person or thing that gives pleasure to the senses or pleasurably exalts the mind or spirit".

Look at this output, isn't it nice that it is colorized.

image

The bash version got away with this because it was piping through jq, I suspect that we won't have this on day one. We will want it though, however this simple ask can get very complex. Since it isn't supported on every terminal, it's also tricky to do well, and you likely need to understand JSON and maybe have a lexer. In #16 we might have included the gojq library in the project, and it may help us here.

Acceptance Criteria

  1. json output as a result of successful commands (e.g., test-json command support #16 get Support (Basic). #2 ) should be pretty printed.
  2. Structural elements like commas, colons, parenthesis should be a specific color.
  3. Keys should be another color
  4. Strings should be another color.
  5. null should be a different color
  6. true false should be another color.
  7. Maybe consider whether specific keys or paths should be distinct colors, we can draw peoples attension to specific and more important elements (e.g., name and email), and less away from boiler plate like (data or id).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions