Skip to content

Commit f1eb29b

Browse files
committed
Add colorableErr
1 parent fee3036 commit f1eb29b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

command/root.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,11 @@ func colorableOut(cmd *cobra.Command) io.Writer {
117117
}
118118
return out
119119
}
120+
121+
func colorableErr(cmd *cobra.Command) io.Writer {
122+
out := cmd.ErrOrStderr()
123+
if outFile, isFile := out.(*os.File); isFile {
124+
return utils.NewColorable(outFile)
125+
}
126+
return out
127+
}

0 commit comments

Comments
 (0)