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

feat!: revamp default output behavior #144

Merged
merged 1 commit into from
Nov 22, 2022
Merged

feat!: revamp default output behavior #144

merged 1 commit into from
Nov 22, 2022

Conversation

danielgtaylor
Copy link
Owner

This includes a number of small but related changes, the biggest being the breaking change in default output behavior when redirecting output to a file or pipe as it now just sends the response body as JSON when no filters are passed. List of all changes:

  • Default redirected output to response body as JSON
  • Remove --rsh-table in favor of -o table
  • Reuse registered content types as output marshallers
  • Add a PrettyMarshaller which content types can (optionally) provide, e.g. JSON and Ion provide one now.
  • Readable output now colorizes matching braces/brackets
  • Differentiate between TTY and color within the code
  • When the filter -f option doesn't start with e.g. body, headers, or one of the valid other values it now returns an error rather than no output.

Note: this is a breaking change in behavior.

- Default redirected output to response body as JSON
- Remove `--rsh-table` in favor of `-o table`
- Reuse registered content types as output marshallers
- Add a `PrettyMarshaller` which content types can (optionally) provide, e.g. JSON and Ion provide one now.
- Readable output now colorizes matching braces/brackets
- Differentiate between TTY and color within the code
- When the filter `-f` option doesn't start with e.g. `body`, `headers`, or one of the valid other values it now returns an error rather than no output.

Note: this is a breaking change in behavior.
@codecov
Copy link

codecov bot commented Nov 22, 2022

Codecov Report

Merging #144 (68e25ad) into main (4d63ce1) will increase coverage by 3.48%.
The diff coverage is 81.99%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
+ Coverage   62.74%   66.22%   +3.48%     
==========================================
  Files          22       22              
  Lines        2518     2594      +76     
==========================================
+ Hits         1580     1718     +138     
+ Misses        760      698      -62     
  Partials      178      178              
Impacted Files Coverage Δ
cli/auth.go 12.69% <0.00%> (ø)
cli/logger.go 13.04% <0.00%> (+4.34%) ⬆️
cli/edit.go 83.33% <66.66%> (ø)
cli/content.go 75.78% <72.46%> (-3.91%) ⬇️
cli/cli.go 69.15% <79.16%> (-0.75%) ⬇️
cli/formatter.go 88.94% <86.55%> (+31.27%) ⬆️
cli/apiconfig.go 81.48% <90.32%> (+18.71%) ⬆️
cli/lexer.go 72.64% <100.00%> (+2.00%) ⬆️
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d63ce1...68e25ad. Read the comment docs.

@danielgtaylor danielgtaylor merged commit e73c737 into main Nov 22, 2022
@danielgtaylor danielgtaylor deleted the default-output branch November 22, 2022 00:52
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

Successfully merging this pull request may close these issues.

None yet

1 participant