-
Notifications
You must be signed in to change notification settings - Fork 1
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: output flag all commands #201
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same pattern repeated:
- add the outputter to a command handler
- update tests to make sure it's called with a JSON response and returns the JSON
cmd/flags/create.go
Outdated
@@ -74,7 +75,15 @@ func runCreate(client flags.Client) func(*cobra.Command, []string) error { | |||
return err | |||
} | |||
|
|||
fmt.Fprintf(cmd.OutOrStdout(), string(response)+"\n") | |||
output, err := output.CmdOutput( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@k3llymariee At some point for the dynamic endpoint function, we'll need a field that defines which function to call for each action.
* Show plaintext response for config --list * Use map for output type * Refactor types * Organization * Remove extra type * feat: output flag errors (#204) * Add plain text error handling * Output flag errors as plain text or JSON * Remove unused code * Update all commands to return plaintext or JSON * Refactor outputter * Backfill tests * Reorganize * Refactor * Remove comments * Renamed functions
Sets up support for the output flag for all endpoints except config (for now).
Requirements
Related issues
Provide links to any issues in this repository or elsewhere relating to this pull request.
Describe the solution you've provided
Provide a clear and concise description of what you expect to happen.
Describe alternatives you've considered
Provide a clear and concise description of any alternative solutions or features you've considered.
Additional context
Add any other context about the pull request here.