Skip to content

Commit

Permalink
Merge pull request #79 from deltaskelta/readme-tty-note
Browse files Browse the repository at this point in the history
Changed README Disable section to Disable/Enable
  • Loading branch information
fatih authored Sep 26, 2017
2 parents 1535ebc + 7a9c8b7 commit 5df930a
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,15 @@ defer color.Unset() // Use it in your function
fmt.Println("All text will now be bold magenta.")
```

### Disable color

There might be a case where you want to disable color output (for example to
pipe the standard output of your app to somewhere else). `Color` has support to
disable colors both globally and for single color definition. For example
suppose you have a CLI app and a `--no-color` bool flag. You can easily disable
the color output with:
### Disable/Enable color

There might be a case where you want to explicitly disable/enable color output. the
`go-isatty` package will automatically disable color output for non-tty output streams
(for example if the output were piped directly to `less`)

`Color` has support to disable/enable colors both globally and for single color
definitions. For example suppose you have a CLI app and a `--no-color` bool flag. You
can easily disable the color output with:

```go

Expand Down

0 comments on commit 5df930a

Please sign in to comment.