-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bug/fixSomething isn't working or needs updating.Something isn't working or needs updating.
Description
When a user uses a command that should return an error, the program will display a stylized error message but the return code is 0.
Update to the HandleCommandOutput() function.
Current:
func HandleCommandOutput(fn func() (string, error)) func() {
return func() {
output, err := fn()
if err != nil {
fmt.Fprintln(os.Stderr, output)
return
}
fmt.Println(output)
}
}New:
func HandleCommandOutput(fn func() (string, error)) func() int {
return func() int {
output, err := fn()
if err != nil {
fmt.Fprintln(os.Stderr, output)
return 1
}
fmt.Println(output)
return 0
}
}Metadata
Metadata
Assignees
Labels
bug/fixSomething isn't working or needs updating.Something isn't working or needs updating.
Projects
Status
Completed