Skip to content

Commit

Permalink
Merge pull request #92 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.1.2
  • Loading branch information
andyone authored Apr 1, 2024
2 parents cba41aa + 25c54f9 commit 02bc53f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 287 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

strategy:
matrix:
go: [ '1.20.x', '1.21.x' ]
go: [ '1.21.x', '1.22.x' ]

steps:
- name: Checkout
Expand Down
32 changes: 27 additions & 5 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ import (
"strings"
"time"

"github.com/essentialkaos/ek/v12/env"
"github.com/essentialkaos/ek/v12/fmtc"
"github.com/essentialkaos/ek/v12/fmtutil"
"github.com/essentialkaos/ek/v12/options"
"github.com/essentialkaos/ek/v12/signal"
"github.com/essentialkaos/ek/v12/support"
"github.com/essentialkaos/ek/v12/support/apps"
"github.com/essentialkaos/ek/v12/support/deps"
"github.com/essentialkaos/ek/v12/timeutil"
"github.com/essentialkaos/ek/v12/usage"
"github.com/essentialkaos/ek/v12/usage/completion/bash"
Expand All @@ -27,7 +31,6 @@ import (
"github.com/essentialkaos/ek/v12/usage/man"
"github.com/essentialkaos/ek/v12/usage/update"

"github.com/essentialkaos/fz/cli/support"
"github.com/essentialkaos/fz/gofuzz"
)

Expand All @@ -36,7 +39,7 @@ import (
// App info
const (
APP = "fz"
VER = "1.1.1"
VER = "1.1.2"
DESC = "Tool for formatting go-fuzz output"
)

Expand Down Expand Up @@ -97,7 +100,12 @@ func Run(gitRev string, gomod []byte) {
genAbout(gitRev).Print(options.GetS(OPT_VER))
os.Exit(0)
case options.GetB(OPT_VERB_VER):
support.Print(APP, VER, gitRev, gomod)
support.Collect(APP, VER).
WithRevision(gitRev).
WithDeps(deps.Extract(gomod)).
WithApps(apps.Golang()).
WithChecks(checkForGoFuzz()).
Print()
os.Exit(0)
case options.GetB(OPT_HELP) || !hasStdinData():
genUsage().Print()
Expand Down Expand Up @@ -254,6 +262,17 @@ func printError(f string, a ...any) {

// ////////////////////////////////////////////////////////////////////////////////// //

// checkForGoFuzz checks if go-fuzz binary present on the system
func checkForGoFuzz() support.Check {
goFuzzBin := env.Which("go-fuzz")

if goFuzzBin == "" {
return support.Check{support.CHECK_ERROR, "go-fuzz", "Binary not found in PATH"}
}

return support.Check{support.CHECK_OK, "go-fuzz", fmt.Sprintf("Binary found (%s)", goFuzzBin)}
}

// printCompletion prints completion for given shell
func printCompletion() int {
switch options.GetS(OPT_COMPLETION) {
Expand Down Expand Up @@ -309,12 +328,15 @@ func genAbout(gitRev string) *usage.About {
VersionColorTag: colorTagVer,
DescSeparator: "{s}—{!}",

License: "Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>",
UpdateChecker: usage.UpdateChecker{"essentialkaos/fz", update.GitHubChecker},
License: "Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>",
}

if gitRev != "" {
about.Build = "git:" + gitRev
about.UpdateChecker = usage.UpdateChecker{
"essentialkaos/fz",
update.GitHubChecker,
}
}

return about
Expand Down
162 changes: 0 additions & 162 deletions cli/support/support.go

This file was deleted.

40 changes: 0 additions & 40 deletions cli/support/support_darwin.go

This file was deleted.

63 changes: 0 additions & 63 deletions cli/support/support_linux.go

This file was deleted.

6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ go 1.18

require (
github.com/essentialkaos/check v1.4.0
github.com/essentialkaos/depsy v1.1.0
github.com/essentialkaos/ek/v12 v12.93.0
github.com/essentialkaos/ek/v12 v12.113.1
)

require (
github.com/essentialkaos/depsy v1.1.0 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
golang.org/x/sys v0.16.0 // indirect
golang.org/x/sys v0.18.0 // indirect
)
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1n
github.com/essentialkaos/check v1.4.0/go.mod h1:LMKPZ2H+9PXe7Y2gEoKyVAwUqXVgx7KtgibfsHJPus0=
github.com/essentialkaos/depsy v1.1.0 h1:U6dp687UkQwXlZU17Hg2KMxbp3nfZAoZ8duaeUFYvJI=
github.com/essentialkaos/depsy v1.1.0/go.mod h1:kpiTAV17dyByVnrbNaMcZt2jRwvuXClUYOzpyJQwtG8=
github.com/essentialkaos/ek/v12 v12.93.0 h1:5lwuNYgUYjQHy2h57adWt2t1w5L2MxqTPKgHjyH3h6k=
github.com/essentialkaos/ek/v12 v12.93.0/go.mod h1:peB5w8zUkRuDs7m/QG5Z2gMmqzSIs2viAmxzzNFIIoo=
github.com/essentialkaos/ek/v12 v12.113.1 h1:3opV9dwRpIQq1fqg5mkaSEt6ogECL4VLzrH/829qeYg=
github.com/essentialkaos/ek/v12 v12.113.1/go.mod h1:SslW97Se34YQKc08Ume2V/8h/HPTgLS1+Iok64cNF/U=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
Expand All @@ -13,5 +13,5 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M=
github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Loading

0 comments on commit 02bc53f

Please sign in to comment.