Skip to content

Commit

Permalink
Merge pull request #109 from essentialkaos/develop
Browse files Browse the repository at this point in the history
Version 1.0.0
  • Loading branch information
andyone authored Apr 1, 2024
2 parents 2c4f2ce + 285336f commit 6c7e991
Show file tree
Hide file tree
Showing 8 changed files with 30 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.19.x', '1.20.x', '1.21.x' ]
go: [ '1.19.x', '1.20.x', '1.21.x', '1.22.x' ]

steps:
- name: Checkout
Expand Down
32 changes: 20 additions & 12 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package cli

// ////////////////////////////////////////////////////////////////////////////////// //
// //
// Copyright (c) 2023 ESSENTIAL KAOS //
// Copyright (c) 2024 ESSENTIAL KAOS //
// Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0> //
// //
// ////////////////////////////////////////////////////////////////////////////////// //
Expand All @@ -22,22 +22,23 @@ import (
"github.com/essentialkaos/ek/v12/options"
"github.com/essentialkaos/ek/v12/pager"
"github.com/essentialkaos/ek/v12/strutil"
"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/terminal/tty"
"github.com/essentialkaos/ek/v12/usage"
"github.com/essentialkaos/ek/v12/usage/completion/bash"
"github.com/essentialkaos/ek/v12/usage/completion/fish"
"github.com/essentialkaos/ek/v12/usage/completion/zsh"
"github.com/essentialkaos/ek/v12/usage/man"
"github.com/essentialkaos/ek/v12/usage/update"

"github.com/essentialkaos/goheft/cli/support"
)

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

const (
APP = "GoHeft"
VER = "0.8.0"
VER = "1.0.0"
DESC = "Utility for listing sizes of used static libraries"
)

Expand Down Expand Up @@ -85,7 +86,7 @@ var optMap = options.Map{
OPT_MIN_SIZE: {},
OPT_NO_COLOR: {Type: options.BOOL},
OPT_HELP: {Type: options.BOOL},
OPT_VER: {Type: options.BOOL},
OPT_VER: {Type: options.MIXED},

OPT_VERB_VER: {Type: options.BOOL},
OPT_COMPLETION: {},
Expand Down Expand Up @@ -124,7 +125,11 @@ func Run(gitRev string, gomod []byte) {
genAbout(gitRev).Print()
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()).
Print()
os.Exit(0)
case options.GetB(OPT_HELP) || len(args) == 0:
genUsage().Print()
Expand Down Expand Up @@ -257,13 +262,13 @@ func scanPkgImports(file string, store map[string]string) error {
continue
}

pkgInfo := strutil.ReadField(text, 1, false, " ")
pkgName := strutil.ReadField(pkgInfo, 0, false, "=")
pkgInfo := strutil.ReadField(text, 1, false, ' ')
pkgName := strutil.ReadField(pkgInfo, 0, false, '=')

pkgName = normalizePackageName(pkgName)

if store[pkgName] == "" {
store[pkgName] = strutil.ReadField(pkgInfo, 1, false, "=")
store[pkgName] = strutil.ReadField(pkgInfo, 1, false, '=')
}
}

Expand Down Expand Up @@ -379,7 +384,7 @@ func compileBinary(file string) (string, error) {
return "", fmt.Errorf("Can't start build process: %v", err)
}

return strutil.ReadField(workDir, 1, false, "="), nil
return strutil.ReadField(workDir, 1, false, '='), nil
}

// normalizePackageName format package name
Expand Down Expand Up @@ -484,12 +489,15 @@ func genAbout(gitRev string) *usage.About {
VersionColorTag: colorTagVer,
DescSeparator: "—",

License: "Apache License, Version 2.0 <https://www.apache.org/licenses/LICENSE-2.0>",
UpdateChecker: usage.UpdateChecker{"essentialkaos/goheft", 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/goheft",
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.

8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ module github.com/essentialkaos/goheft

go 1.18

require github.com/essentialkaos/ek/v12 v12.113.1

require (
github.com/essentialkaos/depsy v1.1.0
github.com/essentialkaos/ek/v12 v12.92.0
github.com/essentialkaos/depsy v1.1.0 // indirect
golang.org/x/sys v0.18.0 // indirect
)

require golang.org/x/sys v0.15.0 // indirect
Loading

0 comments on commit 6c7e991

Please sign in to comment.