Add more sas tooling

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2025-01-09 16:30:02 +00:00
parent b355f72b2e
commit 79ff5a55e2
8 changed files with 101 additions and 4 deletions

View File

@@ -9,5 +9,12 @@ pkgs.buildGoModule rec {
rev = "17629fe278dd23e12bd6f17ee9db0d2fde37bc6c";
};
vendorHash = "";
patches = [ ./remove-version-flag.patch ];
preBuild = ''
export GOPROXY="goproxy.unx.sas.com"
export GONOSUMDB="*.sas.com,sassoftware.io"
'';
vendorHash = "sha256-nYlJhGe1Jd3/ct0XpTdMqbgnnoYM0dqVVVfr9nVsu4o=";
}

View File

@@ -0,0 +1,33 @@
diff --git a/main.go b/main.go
index 6fee5d3..a8d45dd 100644
--- a/main.go
+++ b/main.go
@@ -5,7 +5,6 @@ import (
"flag"
"fmt"
"os"
- "runtime"
"strings"
"time"
@@ -27,20 +26,8 @@ func main() {
flag.StringVar(&f, "format", "term", "Log output format (one of json|pretty|yaml|line|file|term|logfmt|plain|message|template)")
flag.StringVar(&ml, "l", "trace", "Minimum log level to output (in order, one of trace|debug|info|warn|error|fatal|panic|none|disabled)")
flag.StringVar(&tz, "t", defaultTimeZone, "Timezone to use for formatting log timestamps - One of UTC, Local, or from https://en.wikipedia.org/wiki/List_of_tz_database_time_zones")
- var ver bool
- flag.BoolVar(&ver, "version", false, "Show version information")
flag.Parse()
- if ver {
- fmt.Printf("Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.\n"+
- "Command - %s\n"+
- "Version - %s+%s\n"+
- "Build Date - %s\n"+
- "Compiler - %s %s/%s\n",
- "klog", BuildVersion, BuildCommit, BuildDate, runtime.Version(), runtime.GOOS, runtime.GOARCH)
- os.Exit(0)
- }
-
lf, ok := log.Formatters[f]
if !ok {
fmt.Fprintf(os.Stderr, "invalid value for format: [%s] - must be one of json|pretty|yaml|line|file|term|logfmt|plain|message|template", f)