|
49 | 49 |
|
50 | 50 | // An empty *CodeCompleter struct
|
51 | 51 | cc = NewCodeCompleter()
|
| 52 | + |
| 53 | + envNoColor = env.Bool("NO_COLOR") |
52 | 54 | )
|
53 | 55 |
|
54 | 56 | func main() {
|
@@ -173,7 +175,11 @@ func main() {
|
173 | 175 | os.Chmod(filename, 0o755)
|
174 | 176 | }
|
175 | 177 | if tailString != "" && !batFlag {
|
176 |
| - fmt.Printf("Wrote %d bytes to %s from the clipboard. Tail bytes: %s\n", n, filename, strings.TrimSpace(strings.ReplaceAll(tailString, "\n", "\\n"))) |
| 178 | + if envNoColor { |
| 179 | + fmt.Printf("Wrote %d bytes to %s from the clipboard. Tail bytes: %s\n", n, filename, strings.TrimSpace(strings.ReplaceAll(tailString, "\n", "\\n"))) |
| 180 | + } else { |
| 181 | + fmt.Printf("Wrote %s%d%s bytes to %s from the clipboard. Tail bytes: %s%s%s\n", vt100.Red, n, vt100.Stop(), filename, vt100.LightBlue, strings.TrimSpace(strings.ReplaceAll(tailString, "\n", "\\n")), vt100.Stop()) |
| 182 | + } |
177 | 183 | } else {
|
178 | 184 | fmt.Printf("Wrote %d bytes to %s from the clipboard.\n", n, filename)
|
179 | 185 | }
|
@@ -207,7 +213,11 @@ func main() {
|
207 | 213 | batFlag = true
|
208 | 214 | }
|
209 | 215 | if tailString != "" && !batFlag {
|
210 |
| - fmt.Printf("Copied %d byte%s from %s to the clipboard. Tail bytes: %s\n", n, plural, filename, strings.TrimSpace(strings.ReplaceAll(tailString, "\n", "\\n"))) |
| 216 | + if envNoColor { |
| 217 | + fmt.Printf("Copied %d byte%s from %s to the clipboard. Tail bytes: %s\n", n, plural, filename, strings.TrimSpace(strings.ReplaceAll(tailString, "\n", "\\n"))) |
| 218 | + } else { |
| 219 | + fmt.Printf("Copied %s%d%s byte%s from %s to the clipboard. Tail bytes: %s%s%s\n", vt100.Yellow, n, vt100.Stop(), plural, filename, vt100.LightCyan, strings.TrimSpace(strings.ReplaceAll(tailString, "\n", "\\n")), vt100.Stop()) |
| 220 | + } |
211 | 221 | } else {
|
212 | 222 | fmt.Printf("Copied %d byte%s from %s to the clipboard.\n", n, plural, filename)
|
213 | 223 | }
|
|
0 commit comments