From a2c2a59f4dec4818693da292417927a097e3586b Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 29 May 2020 02:49:07 +0300 Subject: [PATCH 1/4] Update ek package to v12 --- fz.go | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/fz.go b/fz.go index 1468870..3c13924 100644 --- a/fz.go +++ b/fz.go @@ -16,17 +16,17 @@ import ( "strings" "time" - "pkg.re/essentialkaos/ek.v11/fmtc" - "pkg.re/essentialkaos/ek.v11/fmtutil" - "pkg.re/essentialkaos/ek.v11/options" - "pkg.re/essentialkaos/ek.v11/signal" - "pkg.re/essentialkaos/ek.v11/strutil" - "pkg.re/essentialkaos/ek.v11/timeutil" - "pkg.re/essentialkaos/ek.v11/usage" - "pkg.re/essentialkaos/ek.v11/usage/completion/bash" - "pkg.re/essentialkaos/ek.v11/usage/completion/fish" - "pkg.re/essentialkaos/ek.v11/usage/completion/zsh" - "pkg.re/essentialkaos/ek.v11/usage/update" + "pkg.re/essentialkaos/ek.v12/fmtc" + "pkg.re/essentialkaos/ek.v12/fmtutil" + "pkg.re/essentialkaos/ek.v12/options" + "pkg.re/essentialkaos/ek.v12/signal" + "pkg.re/essentialkaos/ek.v12/strutil" + "pkg.re/essentialkaos/ek.v12/timeutil" + "pkg.re/essentialkaos/ek.v12/usage" + "pkg.re/essentialkaos/ek.v12/usage/completion/bash" + "pkg.re/essentialkaos/ek.v12/usage/completion/fish" + "pkg.re/essentialkaos/ek.v12/usage/completion/zsh" + "pkg.re/essentialkaos/ek.v12/usage/update" ) // ////////////////////////////////////////////////////////////////////////////////// // @@ -34,7 +34,7 @@ import ( // App info const ( APP = "fz" - VER = "0.0.2" + VER = "0.0.3" DESC = "Tool for formatting go-fuzz output" ) @@ -203,7 +203,7 @@ func renderInfo(cur Info) { execsArrow := getDynamicsArrow(cur.ExecsPerSec, prevInfo.ExecsPerSec) fmtc.TPrintf( - "{s}%s{!} {s-}[%s]{!} {*}Workers:{!} "+workersTag+"%d{!} {s}│{!} {*}Corpus:{!} "+corpusTag+"%s{!} {s-}(%s){!} {s}│{!} {*}Crashers:{!} "+crashersTag+"%d {s}│{!} {*}Restarts:{!} %s {s}│{!} {*}Cover:{!} "+coverTag+"%s{!} {s}│{!} {*}Execs:{!} {s}%s{!}%s{s}/s{!} {s-}(%s){!}", + "{s}%s{!} {s-}[%s]{!} {*}Workers:{!} "+workersTag+"%d{!} {s-}•{!} {*}Corpus:{!} "+corpusTag+"%s{!} {s-}(%s){!} {s-}•{!} {*}Crashers:{!} "+crashersTag+"%d {s-}•{!} {*}Restarts:{!} %s {s-}•{!} {*}Cover:{!} "+coverTag+"%s{!} {s-}•{!} {*}Execs:{!} {s}%s{!}%s{s}/s{!} {s-}(%s){!}", cur.DateTime, formatDuration(cur.Uptime), cur.Workers, fmtutil.PrettyNum(cur.Corpus), formatDuration(cur.CorpusDur), cur.Crashers, cur.Restarts, fmtutil.PrettyNum(cur.Cover), execsArrow, fmtutil.PrettyNum(cur.ExecsPerSec), fmtutil.PrettyNum(cur.Execs), @@ -223,7 +223,7 @@ func printResults() { execs := fmtutil.PrettyNum(prevInfo.Execs) fmtc.TPrintf( - "{*}Duration:{!} %s {s}│{!} {*}Execs:{!} %s {s}│{!} {*}Corpus:{!} %s {s}│{!} {*}Crashers:{!} %s {s}│{!} {*}Cover:{!} %s\n", + "{*}Duration:{!} %s {s-}•{!} {*}Execs:{!} %s {s-}•{!} {*}Corpus:{!} %s {s-}•{!} {*}Crashers:{!} %s {s-}•{!} {*}Cover:{!} %s\n", duration, execs, corpus, crashers, cover, ) } From 29df10a0df8ec414756ec91a3f4bcd7bb3622ed3 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 29 May 2020 02:49:44 +0300 Subject: [PATCH 2/4] Update TravisCI config --- .travis.yml | 4 +--- README.md | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5e2fed7..97b8bb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: go go: - - 1.10.x - - 1.11.x - - 1.12.x - 1.13.x + - 1.14.x - tip os: diff --git a/README.md b/README.md index 8b548a5..fb64500 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Before the initial install, allow git to use redirects for [pkg.re](https://gith git config --global http.https://pkg.re.followRedirects true ``` -To build the `fz` from scratch, make sure you have a working Go 1.10+ workspace (_[instructions](https://golang.org/doc/install)_), then: +To build the `fz` from scratch, make sure you have a working Go 1.13+ workspace (_[instructions](https://golang.org/doc/install)_), then: ``` go get github.com/essentialkaos/fz From b52aeee41d360de41b959a948272763aa0369f31 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 29 May 2020 02:53:24 +0300 Subject: [PATCH 3/4] Update Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index e7570c4..b195647 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ git-config: ## Configure git redirects for stable import path services git config --global http.https://pkg.re.followRedirects true deps: git-config ## Download dependencies - go get -d -v pkg.re/essentialkaos/ek.v11 + go get -d -v pkg.re/essentialkaos/ek.v12 fmt: ## Format source code with gofmt find . -name "*.go" -exec gofmt -s -w {} \; From 5e34c87e69b8a4c35602accbd04ada8496870791 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Sat, 30 May 2020 02:02:17 +0300 Subject: [PATCH 4/4] Minor UI improvements + New demo --- README.md | 2 +- fz.go | 19 ++----------------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index fb64500..d6b9f3e 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ ### Usage demo -[![demo](https://gh.kaos.st/fz-001.gif)](#usage-demo) +[![demo](https://gh.kaos.st/fz-003.gif)](#usage-demo) ### Installation diff --git a/fz.go b/fz.go index 3c13924..c4951ef 100644 --- a/fz.go +++ b/fz.go @@ -200,13 +200,11 @@ func renderInfo(cur Info) { crashersTag = "{r}" } - execsArrow := getDynamicsArrow(cur.ExecsPerSec, prevInfo.ExecsPerSec) - fmtc.TPrintf( - "{s}%s{!} {s-}[%s]{!} {*}Workers:{!} "+workersTag+"%d{!} {s-}•{!} {*}Corpus:{!} "+corpusTag+"%s{!} {s-}(%s){!} {s-}•{!} {*}Crashers:{!} "+crashersTag+"%d {s-}•{!} {*}Restarts:{!} %s {s-}•{!} {*}Cover:{!} "+coverTag+"%s{!} {s-}•{!} {*}Execs:{!} {s}%s{!}%s{s}/s{!} {s-}(%s){!}", + "{s}%s{!} {s-}[%s]{!} {*}Workers:{!} "+workersTag+"%d{!} {s-}•{!} {*}Corpus:{!} "+corpusTag+"%s{!} {s-}(%s){!} {s-}•{!} {*}Crashers:{!} "+crashersTag+"%d {s-}•{!} {*}Restarts:{!} %s {s-}•{!} {*}Cover:{!} "+coverTag+"%s{!} {s-}•{!} {*}Execs:{!} %s{s}/s{!} {s-}(%s){!}", cur.DateTime, formatDuration(cur.Uptime), cur.Workers, fmtutil.PrettyNum(cur.Corpus), formatDuration(cur.CorpusDur), cur.Crashers, cur.Restarts, fmtutil.PrettyNum(cur.Cover), - execsArrow, fmtutil.PrettyNum(cur.ExecsPerSec), fmtutil.PrettyNum(cur.Execs), + fmtutil.PrettyNum(cur.ExecsPerSec), fmtutil.PrettyNum(cur.Execs), ) } @@ -241,19 +239,6 @@ func getIndicatorTag(v1, v2 int) string { } } -// getIndicatorTag returns arrow symbol based on difference between -// current and previous values -func getDynamicsArrow(v1, v2 int) string { - switch { - case v1 > v2: - return "↑" - case v1 < v2: - return "↓" - default: - return "" - } -} - // formatDuration formats duration func formatDuration(d int64) string { var min, sec int64