-
Notifications
You must be signed in to change notification settings - Fork 13
feat: output flag errors #204
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
Changes from all commits
7fc4a54
313bf1f
83745de
d41e2c1
526bbec
f8de751
614b6f0
1764f0e
d6b08f2
62d1f66
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,7 @@ import ( | |
|
|
||
| "ldcli/cmd/cliflags" | ||
| "ldcli/cmd/validators" | ||
| "ldcli/internal/errors" | ||
| "ldcli/internal/members" | ||
| "ldcli/internal/output" | ||
| ) | ||
|
|
@@ -61,15 +62,25 @@ func runInvite(client members.Client) func(*cobra.Command, []string) error { | |
| memberInputs, | ||
| ) | ||
| if err != nil { | ||
| return err | ||
| output, err := output.CmdOutputSingular( | ||
| viper.GetString(cliflags.OutputFlag), | ||
| []byte(err.Error()), | ||
| output.ErrorPlaintextOutputFn, | ||
| ) | ||
| if err != nil { | ||
| return errors.NewError(err.Error()) | ||
| } | ||
|
|
||
| return errors.NewError(output) | ||
| } | ||
|
|
||
| output, err := output.CmdOutput( | ||
| output, err := output.CmdOutputMultiple( | ||
| viper.GetString(cliflags.OutputFlag), | ||
| output.NewSingularOutput(response), | ||
| response, | ||
| output.MultipleEmailPlaintextOutputFn, | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's an example of a different function used because the response is which is different from a normal "list" type of response because
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fun times! can't wait to find more |
||
| ) | ||
| if err != nil { | ||
| return err | ||
| return errors.NewError(err.Error()) | ||
| } | ||
|
|
||
| fmt.Fprintf(cmd.OutOrStdout(), output+"\n") | ||
|
|
||
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.
Turns out we don't need to do this. It will be easier to remove these with the generated commands since they'll only be written once.