summaryrefslogtreecommitdiff
path: root/internal/color/table.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2021-10-09 21:10:29 +0300
committerPaul Buetow <paul@buetow.org>2021-10-10 13:36:41 +0300
commit97747ea0f3178f7f5890512d483fdccaa82846b0 (patch)
tree9ff1335ca26afc90e55fd6de416457e252d75a35 /internal/color/table.go
parent7a7169791a64190e1002e38bc9c04ad0d5c1ce1f (diff)
vetting and linting and some code restyling
Diffstat (limited to 'internal/color/table.go')
-rw-r--r--internal/color/table.go19
1 files changed, 16 insertions, 3 deletions
diff --git a/internal/color/table.go b/internal/color/table.go
index 2115edf..e0e4946 100644
--- a/internal/color/table.go
+++ b/internal/color/table.go
@@ -5,8 +5,19 @@ import (
"os"
)
-const sampleParagraph string = "Mimecast is Making Email Safer for Business. We believe that securely operating a business in the cloud requires new levels of IT preparedness, centered around cyber resilience. This is why we unify the delivery and management of security, continuity and data protection for email via one, simple-to-use cloud platform. Thousands of organizations trust us to increase their cyber resilience preparedness, streamline compliance, reduce IT complexity and keep their business running. We give employees fast and secure access to sensitive business information, and ensure email keeps flowing in the event of an outage. Mimecast will remain committed to protecting your IT assets through constant innovation and focus on your success."
+const sampleParagraph string = "Mimecast is Making Email Safer for Business. " +
+ "We believe that securely operating a business in the cloud requires new " +
+ "levels of IT preparedness, centered around cyber resilience. This is why " +
+ "we unify the delivery and management of security, continuity and data " +
+ "protection for email via one, simple-to-use cloud platform. Thousands of " +
+ "organizations trust us to increase their cyber resilience preparedness, " +
+ "streamline compliance, reduce IT complexity and keep their business running. " +
+ "We give employees fast and secure access to sensitive business information, " +
+ "and ensure email keeps flowing in the event of an outage. Mimecast will " +
+ "remain committed to protecting your IT assets through constant innovation " +
+ "and focus on your success."
+// TablePrintAndExit prints the color table and then exits the process.
func TablePrintAndExit(displaySampleParagraph bool) {
for _, attr := range AttributeNames {
if attr == "Hidden" || attr == "SlowBlink" {
@@ -24,11 +35,13 @@ func printColorTable(attr string, displaySampleParagraph bool) {
if fg == bg {
continue
}
+
bgColor, _ := ToBgColor(bg)
attribute, _ := ToAttribute(attr)
-
- text := fmt.Sprintf(" Foreground:%10s | Background:%10s | Attribute:%10s ", fg, bg, attr)
+ text := fmt.Sprintf(" Foreground:%10s | Background:%10s | Attribute:%10s ",
+ fg, bg, attr)
fmt.Print(PaintStrWithAttr(text, fgColor, bgColor, attribute))
+
if displaySampleParagraph {
fmt.Print("\n")
fmt.Print(PaintStrWithAttr(sampleParagraph, fgColor, bgColor, attribute))