summaryrefslogtreecommitdiff
path: root/vendor/github.com/magefile/mage/mg/color.go
diff options
context:
space:
mode:
authordependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>2021-03-10 09:17:58 +0000
committerDaniel J Walsh <dwalsh@redhat.com>2021-03-12 06:15:31 -0500
commit12fb9e46538621ed494f692085e3c567822262da (patch)
treef49dcc608f2e3f742a01ab7d04f94e06bde75c64 /vendor/github.com/magefile/mage/mg/color.go
parent81737b37738dfa21be3cf9775919458523511ae9 (diff)
downloadpodman-12fb9e46538621ed494f692085e3c567822262da.tar.gz
podman-12fb9e46538621ed494f692085e3c567822262da.tar.bz2
podman-12fb9e46538621ed494f692085e3c567822262da.zip
Bump github.com/sirupsen/logrus from 1.8.0 to 1.8.1
Bumps [github.com/sirupsen/logrus](https://github.com/sirupsen/logrus) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/sirupsen/logrus/releases) - [Changelog](https://github.com/sirupsen/logrus/blob/master/CHANGELOG.md) - [Commits](https://github.com/sirupsen/logrus/compare/v1.8.0...v1.8.1) Signed-off-by: dependabot-preview[bot] <support@dependabot.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/magefile/mage/mg/color.go')
-rw-r--r--vendor/github.com/magefile/mage/mg/color.go80
1 files changed, 0 insertions, 80 deletions
diff --git a/vendor/github.com/magefile/mage/mg/color.go b/vendor/github.com/magefile/mage/mg/color.go
deleted file mode 100644
index 3e2710332..000000000
--- a/vendor/github.com/magefile/mage/mg/color.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package mg
-
-// Color is ANSI color type
-type Color int
-
-// If you add/change/remove any items in this constant,
-// you will need to run "stringer -type=Color" in this directory again.
-// NOTE: Please keep the list in an alphabetical order.
-const (
- Black Color = iota
- Red
- Green
- Yellow
- Blue
- Magenta
- Cyan
- White
- BrightBlack
- BrightRed
- BrightGreen
- BrightYellow
- BrightBlue
- BrightMagenta
- BrightCyan
- BrightWhite
-)
-
-// AnsiColor are ANSI color codes for supported terminal colors.
-var ansiColor = map[Color]string{
- Black: "\u001b[30m",
- Red: "\u001b[31m",
- Green: "\u001b[32m",
- Yellow: "\u001b[33m",
- Blue: "\u001b[34m",
- Magenta: "\u001b[35m",
- Cyan: "\u001b[36m",
- White: "\u001b[37m",
- BrightBlack: "\u001b[30;1m",
- BrightRed: "\u001b[31;1m",
- BrightGreen: "\u001b[32;1m",
- BrightYellow: "\u001b[33;1m",
- BrightBlue: "\u001b[34;1m",
- BrightMagenta: "\u001b[35;1m",
- BrightCyan: "\u001b[36;1m",
- BrightWhite: "\u001b[37;1m",
-}
-
-// AnsiColorReset is an ANSI color code to reset the terminal color.
-const AnsiColorReset = "\033[0m"
-
-// DefaultTargetAnsiColor is a default ANSI color for colorizing targets.
-// It is set to Cyan as an arbitrary color, because it has a neutral meaning
-var DefaultTargetAnsiColor = ansiColor[Cyan]
-
-func toLowerCase(s string) string {
- // this is a naive implementation
- // borrowed from https://golang.org/src/strings/strings.go
- // and only considers alphabetical characters [a-zA-Z]
- // so that we don't depend on the "strings" package
- buf := make([]byte, len(s))
- for i := 0; i < len(s); i++ {
- c := s[i]
- if 'A' <= c && c <= 'Z' {
- c += 'a' - 'A'
- }
- buf[i] = c
- }
- return string(buf)
-}
-
-func getAnsiColor(color string) (string, bool) {
- colorLower := toLowerCase(color)
- for k, v := range ansiColor {
- colorConstLower := toLowerCase(k.String())
- if colorConstLower == colorLower {
- return v, true
- }
- }
- return "", false
-}