From 2b2b3066b6133a89a1135438634a1f50ca1d3b33 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Fri, 22 Nov 2019 23:02:55 +0100 Subject: [PATCH] add usage --- print.go | 15 +++++++++++++++ usage.go | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 print.go create mode 100644 usage.go diff --git a/print.go b/print.go new file mode 100644 index 0000000..082e359 --- /dev/null +++ b/print.go @@ -0,0 +1,15 @@ +package main + +import "fmt" + +func bold(str string) string { + return fmt.Sprintf("\x1b[1m%s\x1b[0m", str) +} + +func success(str string) string { + return fmt.Sprintf("\x1b[58;2;26;221;120m%s\x1b[0m", str) +} + +func error(str string) string { + return fmt.Sprintf("\x1b[58;2;221;26;120m%s\x1b[0m", str) +} diff --git a/usage.go b/usage.go new file mode 100644 index 0000000..9474ce0 --- /dev/null +++ b/usage.go @@ -0,0 +1,33 @@ +package main + +import "fmt" + +func usage() { + fmt.Printf(` +%s + cliverage - print human-readable golang code coverage + +%s + %s codepath coverfile [filepath] + +%s + codepath + Path to where lives your code + + coverfile + Path to the coverage file generated by "go test -coverprofile". + + filepath + Optional path to a file (relative to %s). + +%s + Adrien Marquès (aka. xdrm-brackets) +`, + bold("NAME"), + bold("SYNOPSIS"), + bold("cliverage"), + bold("ARGUMENTS"), + bold("codepath"), + bold("AUTHORS"), + ) +}