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

CLI: all responses are displayable in JSON #1004

Merged
merged 4 commits into from
Dec 6, 2023
Merged

Conversation

Keksoj
Copy link
Contributor

@Keksoj Keksoj commented Oct 16, 2023

Some CLI commands would not display responses in a JSON format with the --json option.

This PR makes the --json option global and ensures all responses are displayable in JSON.

@Keksoj Keksoj added the bug label Oct 16, 2023
@Keksoj Keksoj added this to the v0.16.0 milestone Oct 16, 2023
@Keksoj Keksoj self-assigned this Oct 16, 2023
@Keksoj Keksoj requested a review from Wonshtrum as a code owner October 16, 2023 15:19
@Keksoj Keksoj force-pushed the fix-display-in-json-form branch 2 times, most recently from 8c909ec to 8c5e442 Compare October 17, 2023 09:54
@Keksoj
Copy link
Contributor Author

Keksoj commented Oct 17, 2023

plus a big refactor: remove the display logic from the bin workspace, port it to a display() method on the Response object.

This removes about a hundred lines of boilerplate, and makes everything more readable.

@Keksoj Keksoj force-pushed the fix-display-in-json-form branch 3 times, most recently from b5c3595 to 2ba80a2 Compare October 17, 2023 10:33
@Keksoj Keksoj force-pushed the fix-display-in-json-form branch 2 times, most recently from c193757 to 97b4f01 Compare November 22, 2023 10:27
@Keksoj Keksoj force-pushed the fix-display-in-json-form branch 2 times, most recently from f0ba2cd to 88fb8cb Compare November 27, 2023 14:19
@Keksoj Keksoj force-pushed the fix-display-in-json-form branch from 88fb8cb to 86303a2 Compare December 6, 2023 16:08
remove bin/cli/display.rs since it is ported
add json field to CommandManager
add global json option to CLI arguments
put certificate loading functions in certificate module
so that the output of --json commands is pipeable
display "no cluster found" if response is empty
@Keksoj Keksoj merged commit 0b744b4 into main Dec 6, 2023
12 checks passed
@Keksoj Keksoj deleted the fix-display-in-json-form branch February 8, 2024 13:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants