summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/mgutz
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-08-06 21:47:05 +0200
committerWim <wim@42.be>2018-08-06 21:47:05 +0200
commit51062863a5c34d81e296cf15c61140911037cf3b (patch)
tree9b5e044672486326c7a0ca8fb26430f37bf4d83c /vendor/github.com/mgutz
parent4fb4b7aa6c02a54db8ad8dd98e4d321396926c0d (diff)
downloadmatterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.gz
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.bz2
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.zip
Use mod vendor for vendored directory (backwards compatible)
Diffstat (limited to 'vendor/github.com/mgutz')
-rw-r--r--vendor/github.com/mgutz/ansi/.gitignore1
-rw-r--r--vendor/github.com/mgutz/ansi/README.md121
-rw-r--r--vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go135
3 files changed, 122 insertions, 135 deletions
diff --git a/vendor/github.com/mgutz/ansi/.gitignore b/vendor/github.com/mgutz/ansi/.gitignore
new file mode 100644
index 00000000..9ed3b07c
--- /dev/null
+++ b/vendor/github.com/mgutz/ansi/.gitignore
@@ -0,0 +1 @@
+*.test
diff --git a/vendor/github.com/mgutz/ansi/README.md b/vendor/github.com/mgutz/ansi/README.md
new file mode 100644
index 00000000..8f8e20b7
--- /dev/null
+++ b/vendor/github.com/mgutz/ansi/README.md
@@ -0,0 +1,121 @@
+# ansi
+
+Package ansi is a small, fast library to create ANSI colored strings and codes.
+
+## Install
+
+Get it
+
+```sh
+go get -u github.com/mgutz/ansi
+```
+
+## Example
+
+```go
+import "github.com/mgutz/ansi"
+
+// colorize a string, SLOW
+msg := ansi.Color("foo", "red+b:white")
+
+// create a FAST closure function to avoid computation of ANSI code
+phosphorize := ansi.ColorFunc("green+h:black")
+msg = phosphorize("Bring back the 80s!")
+msg2 := phospohorize("Look, I'm a CRT!")
+
+// cache escape codes and build strings manually
+lime := ansi.ColorCode("green+h:black")
+reset := ansi.ColorCode("reset")
+
+fmt.Println(lime, "Bring back the 80s!", reset)
+```
+
+Other examples
+
+```go
+Color(s, "red") // red
+Color(s, "red+b") // red bold
+Color(s, "red+B") // red blinking
+Color(s, "red+u") // red underline
+Color(s, "red+bh") // red bold bright
+Color(s, "red:white") // red on white
+Color(s, "red+b:white+h") // red bold on white bright
+Color(s, "red+B:white+h") // red blink on white bright
+Color(s, "off") // turn off ansi codes
+```
+
+To view color combinations, from project directory in terminal.
+
+```sh
+go test
+```
+
+## Style format
+
+```go
+"foregroundColor+attributes:backgroundColor+attributes"
+```
+
+Colors
+
+* black
+* red
+* green
+* yellow
+* blue
+* magenta
+* cyan
+* white
+* 0...255 (256 colors)
+
+Foreground Attributes
+
+* B = Blink
+* b = bold
+* h = high intensity (bright)
+* i = inverse
+* s = strikethrough
+* u = underline
+
+Background Attributes
+
+* h = high intensity (bright)
+
+## Constants
+
+* ansi.Reset
+* ansi.DefaultBG
+* ansi.DefaultFG
+* ansi.Black
+* ansi.Red
+* ansi.Green
+* ansi.Yellow
+* ansi.Blue
+* ansi.Magenta
+* ansi.Cyan
+* ansi.White
+* ansi.LightBlack
+* ansi.LightRed
+* ansi.LightGreen
+* ansi.LightYellow
+* ansi.LightBlue
+* ansi.LightMagenta
+* ansi.LightCyan
+* ansi.LightWhite
+
+## References
+
+Wikipedia ANSI escape codes [Colors](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors)
+
+General [tips and formatting](http://misc.flogisoft.com/bash/tip_colors_and_formatting)
+
+What about support on Windows? Use [colorable by mattn](https://github.com/mattn/go-colorable).
+Ansi and colorable are used by [logxi](https://github.com/mgutz/logxi) to support logging in
+color on Windows.
+
+## MIT License
+
+Copyright (c) 2013 Mario Gutierrez mario@mgutz.com
+
+See the file LICENSE for copying permission.
+
diff --git a/vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go b/vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go
deleted file mode 100644
index 736b45dd..00000000
--- a/vendor/github.com/mgutz/ansi/cmd/ansi-mgutz/main.go
+++ /dev/null
@@ -1,135 +0,0 @@
-package main
-
-import (
- "fmt"
- "sort"
- "strconv"
-
- "github.com/mattn/go-colorable"
- "github.com/mgutz/ansi"
-)
-
-func main() {
- printColors()
- print256Colors()
- printConstants()
-}
-
-func pad(s string, length int) string {
- for len(s) < length {
- s += " "
- }
- return s
-}
-
-func padColor(s string, styles []string) string {
- buffer := ""
- for _, style := range styles {
- buffer += ansi.Color(pad(s+style, 20), s+style)
- }
- return buffer
-}
-
-func printPlain() {
- ansi.DisableColors(true)
- bgColors := []string{
- "",
- ":black",
- ":red",
- ":green",
- ":yellow",
- ":blue",
- ":magenta",
- ":cyan",
- ":white",
- }
- for fg := range ansi.Colors {
- for _, bg := range bgColors {
- println(padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg}))
- println(padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h"}))
- println(padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"}))
- }
- }
-}
-
-func printColors() {
- ansi.DisableColors(false)
- stdout := colorable.NewColorableStdout()
-
- bgColors := []string{
- "",
- ":black",
- ":red",
- ":green",
- ":yellow",
- ":blue",
- ":magenta",
- ":cyan",
- ":white",
- }
-
- keys := []string{}
- for fg := range ansi.Colors {
- _, err := strconv.Atoi(fg)
- if err != nil {
- keys = append(keys, fg)
- }
- }
- sort.Strings(keys)
-
- for _, fg := range keys {
- for _, bg := range bgColors {
- fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+bh" + bg, "+u" + bg}))
- fmt.Fprintln(stdout, padColor(fg, []string{"+uh" + bg, "+B" + bg, "+Bb" + bg /* backgrounds */, "" + bg + "+h", "+s" + bg}))
- fmt.Fprintln(stdout, padColor(fg, []string{"+b" + bg + "+h", "+bh" + bg + "+h", "+u" + bg + "+h", "+uh" + bg + "+h"}))
- }
- }
-}
-
-func print256Colors() {
- ansi.DisableColors(false)
- stdout := colorable.NewColorableStdout()
-
- bgColors := []string{""}
- for i := 0; i < 256; i++ {
- key := fmt.Sprintf(":%d", i)
- bgColors = append(bgColors, key)
- }
-
- keys := []string{}
- for fg := range ansi.Colors {
- n, err := strconv.Atoi(fg)
- if err == nil {
- keys = append(keys, fmt.Sprintf("%3d", n))
- }
- }
- sort.Strings(keys)
-
- for _, fg := range keys {
- for _, bg := range bgColors {
- fmt.Fprintln(stdout, padColor(fg, []string{"" + bg, "+b" + bg, "+u" + bg}))
- fmt.Fprintln(stdout, padColor(fg, []string{"+B" + bg, "+Bb" + bg, "+s" + bg}))
- }
- }
-}
-
-func printConstants() {
- stdout := colorable.NewColorableStdout()
- fmt.Fprintln(stdout, ansi.DefaultFG, "ansi.DefaultFG", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Black, "ansi.Black", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Red, "ansi.Red", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Green, "ansi.Green", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Yellow, "ansi.Yellow", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Blue, "ansi.Blue", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Magenta, "ansi.Magenta", ansi.Reset)
- fmt.Fprintln(stdout, ansi.Cyan, "ansi.Cyan", ansi.Reset)
- fmt.Fprintln(stdout, ansi.White, "ansi.White", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightBlack, "ansi.LightBlack", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightRed, "ansi.LightRed", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightGreen, "ansi.LightGreen", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightYellow, "ansi.LightYellow", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightBlue, "ansi.LightBlue", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightMagenta, "ansi.LightMagenta", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightCyan, "ansi.LightCyan", ansi.Reset)
- fmt.Fprintln(stdout, ansi.LightWhite, "ansi.LightWhite", ansi.Reset)
-}