From df914c51147c11c4ecbc40da43583dbe4a778349 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 03:01:44 +0000 Subject: [PATCH 01/13] Bump github.com/essentialkaos/ek/v12 from 12.63.0 to 12.64.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.63.0 to 12.64.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.63.0...v12.64.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 8cc5b90..7e90f71 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.0.0 - github.com/essentialkaos/ek/v12 v12.63.0 + github.com/essentialkaos/ek/v12 v12.64.0 ) require golang.org/x/sys v0.6.0 // indirect diff --git a/go.sum b/go.sum index a0cb15a..e2720f9 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc= github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM= -github.com/essentialkaos/ek/v12 v12.63.0 h1:9yaEu5W3bx//9y52ShqYCoFDKOcwEdrnvgSkUYyatgI= -github.com/essentialkaos/ek/v12 v12.63.0/go.mod h1:9MlSuHpewu7OZ9tM9dLFHvoA8dflBIUPCA0Ctt97wRs= +github.com/essentialkaos/ek/v12 v12.64.0 h1:5HgBltCfY4uwsSFSv+yVBns6UIzXbiNEE31kcm/0UyA= +github.com/essentialkaos/ek/v12 v12.64.0/go.mod h1:9MlSuHpewu7OZ9tM9dLFHvoA8dflBIUPCA0Ctt97wRs= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= From 4467fe41064376c6e1ff07ee5d16102049d83371 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 18 Apr 2023 23:49:59 +0300 Subject: [PATCH 02/13] Dependencies update --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 7e90f71..72c1ce0 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.0.0 - github.com/essentialkaos/ek/v12 v12.64.0 + github.com/essentialkaos/ek/v12 v12.64.1 ) -require golang.org/x/sys v0.6.0 // indirect +require golang.org/x/sys v0.7.0 // indirect diff --git a/go.sum b/go.sum index e2720f9..d66bb5e 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,10 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc= github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM= -github.com/essentialkaos/ek/v12 v12.64.0 h1:5HgBltCfY4uwsSFSv+yVBns6UIzXbiNEE31kcm/0UyA= -github.com/essentialkaos/ek/v12 v12.64.0/go.mod h1:9MlSuHpewu7OZ9tM9dLFHvoA8dflBIUPCA0Ctt97wRs= +github.com/essentialkaos/ek/v12 v12.64.1 h1:XjIF4GHCgVIY0S0KEz8g1OrNrRoHGU+vAUXSYIKNIbI= +github.com/essentialkaos/ek/v12 v12.64.1/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ= -golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= +golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 2754b7403b1cc4cbed1e151f2944c0d85622d396 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 18 Apr 2023 23:50:17 +0300 Subject: [PATCH 03/13] Fix typos --- cli/cli.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/cli.go b/cli/cli.go index 20e137e..6a7629a 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -319,7 +319,7 @@ func printResults() { stats.mx.Unlock() } -// printDistribution prints distrubution info +// printDistribution prints distribution info func printDistribution() { var distData linesSlice From f341137e6de1794108a7fcea3e2acceda36d9a93 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Tue, 18 Apr 2023 23:51:03 +0300 Subject: [PATCH 04/13] Improve CI workflow --- .github/workflows/ci.yml | 26 ++++++++++++++++---------- .typos.toml | 2 ++ 2 files changed, 18 insertions(+), 10 deletions(-) create mode 100644 .typos.toml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b92ce12..8cbb662 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,9 +24,6 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true -env: - SRC_DIR: src/github.com/${{ github.repository }} - jobs: Go: name: Go @@ -37,22 +34,18 @@ jobs: go: [ '1.19.x', '1.20.x' ] steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Go uses: actions/setup-go@v4 with: go-version: ${{ matrix.go }} - - name: Checkout - uses: actions/checkout@v3 - with: - path: ${{env.SRC_DIR}} - - name: Download dependencies - working-directory: ${{env.SRC_DIR}} run: make deps - name: Build binary - working-directory: ${{env.SRC_DIR}} run: make all Perfecto: @@ -76,3 +69,16 @@ jobs: uses: essentialkaos/perfecto-action@v2 with: files: common/uc.spec + + Typos: + name: Typos + runs-on: ubuntu-latest + + needs: Go + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Check spelling + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..55aead8 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,2 @@ +[files] +extend-exclude = ["go.sum"] From 3069d3cbf6e7255dd796855f87bdccf5a9f533ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 02:59:44 +0000 Subject: [PATCH 05/13] Bump github.com/essentialkaos/ek/v12 from 12.64.1 to 12.65.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.64.1 to 12.65.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.64.1...v12.65.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 72c1ce0..b7d8cc2 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.0.0 - github.com/essentialkaos/ek/v12 v12.64.1 + github.com/essentialkaos/ek/v12 v12.65.0 ) require golang.org/x/sys v0.7.0 // indirect diff --git a/go.sum b/go.sum index d66bb5e..908f2b7 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc= github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM= -github.com/essentialkaos/ek/v12 v12.64.1 h1:XjIF4GHCgVIY0S0KEz8g1OrNrRoHGU+vAUXSYIKNIbI= -github.com/essentialkaos/ek/v12 v12.64.1/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g= +github.com/essentialkaos/ek/v12 v12.65.0 h1:OYs8HrVxzzG8CYW9s2wc6Ihfg+ZAnMGB94xzVEC+NMU= +github.com/essentialkaos/ek/v12 v12.65.0/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= From f57f2ebe55c8dbc5a0c2fad47d977633da3a2577 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 3 May 2023 01:50:41 +0300 Subject: [PATCH 06/13] Better stdin handling --- README.md | 2 +- cli/cli.go | 33 +++++++++++++++++++++++++-------- common/uc.spec | 5 ++++- 3 files changed, 30 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 3e27843..8f50f19 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ #### From sources -To build the `uc` from scratch, make sure you have a working Go 1.19+ workspace (_[instructions](https://golang.org/doc/install)_), then: +To build the `uc` from scratch, make sure you have a working Go 1.19+ workspace (_[instructions](https://go.dev/doc/install)_), then: ``` go install github.com/essentialkaos/uc@latest diff --git a/cli/cli.go b/cli/cli.go index 6a7629a..69cf6c2 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -40,7 +40,7 @@ import ( // Application basic info const ( APP = "uc" - VER = "1.1.1" + VER = "2.0.0" DESC = "Tool for counting unique lines" ) @@ -146,7 +146,7 @@ func Run(gitRev string, gomod []byte) { case options.GetB(OPT_VERB_VER): support.Print(APP, VER, gitRev, gomod) os.Exit(0) - case options.GetB(OPT_HELP) || len(args) == 0: + case options.GetB(OPT_HELP): genUsage().Print() os.Exit(0) } @@ -157,7 +157,7 @@ func Run(gitRev string, gomod []byte) { signal.QUIT: signalHandler, }.TrackAsync() - processData(args.Get(0).String()) + processData(args) } // preConfigureUI preconfigures UI based on information about user terminal @@ -197,7 +197,7 @@ func configureUI() { } // processData starts data processing -func processData(input string) { +func processData(args options.Arguments) { var r *bufio.Reader stats = &Stats{ @@ -205,6 +205,8 @@ func processData(input string) { mx: &sync.Mutex{}, } + input := getInput(args) + if input == "-" { r = bufio.NewReader(os.Stdin) } else { @@ -221,6 +223,23 @@ func processData(input string) { readData(bufio.NewScanner(r)) } +// getInput returns input for reading data +func getInput(args options.Arguments) string { + if args.Get(0).String() == "-" || !fsutil.IsCharacterDevice("/dev/stdin") { + return "-" + } + + input := args.Get(0).Clean().String() + err := fsutil.ValidatePerms("FRS", input) + + if err != nil { + printError(err.Error()) + os.Exit(1) + } + + return input +} + // readData reads data func readData(s *bufio.Scanner) { ct := crc64.MakeTable(crc64.ECMA) @@ -416,10 +435,8 @@ func genUsage() *usage.Info { info.AddExample("file.txt", "Count unique lines in file.txt") info.AddExample("-d file.txt", "Show distribution for file.txt") info.AddExample("-d -m 5k file.txt", "Show distribution for file.txt with 5,000 uniq lines max") - info.AddRawExample( - "cat file.txt | "+APP+" -", - "Count unique lines in stdin data", - ) + info.AddRawExample("cat file.txt | "+APP, "Count unique lines in stdin data") + info.AddRawExample(APP+" -m 100 < file.txt", "Count unique lines in stdin data with 100 uniq lines max") return info } diff --git a/common/uc.spec b/common/uc.spec index 36e55cf..a3ab2f3 100644 --- a/common/uc.spec +++ b/common/uc.spec @@ -6,7 +6,7 @@ Summary: Simple utility for counting unique lines Name: uc -Version: 1.1.1 +Version: 2.0.0 Release: 0%{?dist} Group: Applications/System License: Apache License, Version 2.0 @@ -65,6 +65,9 @@ rm -rf %{buildroot} ################################################################################ %changelog +* Wed May 03 2023 Anton Novojilov - 2.0.0-0 +- Better stdin handling + * Mon Mar 06 2023 Anton Novojilov - 1.1.1-0 - Added verbose info output - Dependencies update From e7edfab641c08ac91eaf8b5121b55b526532efcd Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 3 May 2023 01:53:45 +0300 Subject: [PATCH 07/13] Add codeclimate badge --- .codeclimate.yml | 39 +++++++++++++++++++++++++++++++++++++++ README.md | 3 ++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 .codeclimate.yml diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..16f4324 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,39 @@ +version: "2" + +checks: + argument-count: + enabled: true + config: + threshold: 6 + complex-logic: + enabled: true + config: + threshold: 6 + file-lines: + enabled: true + config: + threshold: 1000 + method-complexity: + enabled: true + config: + threshold: 8 + method-count: + enabled: true + config: + threshold: 20 + method-lines: + enabled: true + config: + threshold: 100 + nested-control-flow: + enabled: true + config: + threshold: 6 + return-statements: + enabled: true + config: + threshold: 6 + similar-code: + enabled: false + identical-code: + enabled: false diff --git a/README.md b/README.md index 8f50f19..a89121c 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,10 @@

- GitHub Actions CI Status GoReportCard + Code Climate Maintainability codebeat badge + GitHub Actions CI Status GitHub Actions CodeQL Status

From 4bcf0084bad8e99f8dce457fa2c733f941c14f27 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 May 2023 02:59:24 +0000 Subject: [PATCH 08/13] Bump github.com/essentialkaos/ek/v12 from 12.65.0 to 12.66.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.65.0 to 12.66.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.65.0...v12.66.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index b7d8cc2..ac3fabe 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.0.0 - github.com/essentialkaos/ek/v12 v12.65.0 + github.com/essentialkaos/ek/v12 v12.66.0 ) require golang.org/x/sys v0.7.0 // indirect diff --git a/go.sum b/go.sum index 908f2b7..5fc8962 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc= github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM= -github.com/essentialkaos/ek/v12 v12.65.0 h1:OYs8HrVxzzG8CYW9s2wc6Ihfg+ZAnMGB94xzVEC+NMU= -github.com/essentialkaos/ek/v12 v12.65.0/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g= +github.com/essentialkaos/ek/v12 v12.66.0 h1:g/eg9IPKFDYHt0v5qB3b9pBeSSZ+N7gJdxdOLXIPFLA= +github.com/essentialkaos/ek/v12 v12.66.0/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= From 1b629338f3a98255e667b1fac169426b13d2aff4 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 4 May 2023 11:55:28 +0300 Subject: [PATCH 09/13] Update spec --- common/uc.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/uc.spec b/common/uc.spec index a3ab2f3..88209b3 100644 --- a/common/uc.spec +++ b/common/uc.spec @@ -66,7 +66,7 @@ rm -rf %{buildroot} %changelog * Wed May 03 2023 Anton Novojilov - 2.0.0-0 -- Better stdin handling +- Better standard input handling * Mon Mar 06 2023 Anton Novojilov - 1.1.1-0 - Added verbose info output From 4be3219210c2148c2fb8d740e5c2044e16c2bcff Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Fri, 5 May 2023 02:17:04 +0300 Subject: [PATCH 10/13] Improve README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a89121c..0f85dec 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ Examples uc -d -m 5k file.txt Show distribution for file.txt with 5,000 uniq lines max - cat file.txt | uc - + cat file.txt | uc Count unique lines in stdin data ``` From 8ecb9aa114e899de68a32c66eb32b2e56b1de91c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 03:12:06 +0000 Subject: [PATCH 11/13] Bump github.com/essentialkaos/ek/v12 from 12.66.0 to 12.67.0 Bumps [github.com/essentialkaos/ek/v12](https://github.com/essentialkaos/ek) from 12.66.0 to 12.67.0. - [Release notes](https://github.com/essentialkaos/ek/releases) - [Changelog](https://github.com/essentialkaos/ek/blob/master/CHANGELOG.md) - [Commits](https://github.com/essentialkaos/ek/compare/v12.66.0...v12.67.0) --- updated-dependencies: - dependency-name: github.com/essentialkaos/ek/v12 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 4 ++-- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index ac3fabe..fdde9c1 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.18 require ( github.com/essentialkaos/depsy v1.0.0 - github.com/essentialkaos/ek/v12 v12.66.0 + github.com/essentialkaos/ek/v12 v12.67.0 ) -require golang.org/x/sys v0.7.0 // indirect +require golang.org/x/sys v0.8.0 // indirect diff --git a/go.sum b/go.sum index 5fc8962..8bd890a 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,10 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc= github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM= -github.com/essentialkaos/ek/v12 v12.66.0 h1:g/eg9IPKFDYHt0v5qB3b9pBeSSZ+N7gJdxdOLXIPFLA= -github.com/essentialkaos/ek/v12 v12.66.0/go.mod h1:PFJckNu+x4mHqsjndUeYRDPgDgvZEgcjpy1RpCYtx4g= +github.com/essentialkaos/ek/v12 v12.67.0 h1:ii15t0O+3Mu7uI3Te5X5BIqYXi1V7ovtSIYi5LyiltU= +github.com/essentialkaos/ek/v12 v12.67.0/go.mod h1:sRgw+F7PeeoNsmLLVMKy5ccugwGSljk8/rTXC9dyT+M= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= -golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= +golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= From 9cf946950f375aad415c9e60298da03abf37a652 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Wed, 10 May 2023 01:13:42 +0300 Subject: [PATCH 12/13] Custom version info formats support --- cli/cli.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 69cf6c2..c768c60 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -104,7 +104,7 @@ var optMap = options.Map{ OPT_NO_PROGRESS: {Type: options.BOOL}, 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: {}, @@ -141,7 +141,7 @@ func Run(gitRev string, gomod []byte) { printMan() os.Exit(0) case options.GetB(OPT_VER): - genAbout(gitRev).Print() + genAbout(gitRev).Print(options.GetS(OPT_VER)) os.Exit(0) case options.GetB(OPT_VERB_VER): support.Print(APP, VER, gitRev, gomod) From 7436b39409b83c74bde16ace2c5331f2ac4c42d5 Mon Sep 17 00:00:00 2001 From: Anton Novojilov Date: Thu, 11 May 2023 13:50:43 +0300 Subject: [PATCH 13/13] Dependencies update --- go.mod | 2 +- go.sum | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index fdde9c1..3ce7606 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/essentialkaos/uc go 1.18 require ( - github.com/essentialkaos/depsy v1.0.0 + github.com/essentialkaos/depsy v1.1.0 github.com/essentialkaos/ek/v12 v12.67.0 ) diff --git a/go.sum b/go.sum index 8bd890a..93bd658 100644 --- a/go.sum +++ b/go.sum @@ -1,10 +1,10 @@ github.com/essentialkaos/check v1.4.0 h1:kWdFxu9odCxUqo1NNFNJmguGrDHgwi3A8daXX1nkuKk= -github.com/essentialkaos/depsy v1.0.0 h1:FikBtTnNhk+xFO/hFr+CfiKs6QnA3wMD6tGL0XTEUkc= -github.com/essentialkaos/depsy v1.0.0/go.mod h1:XVsB2eVUonEzmLKQP3ig2P6v2+WcHVgJ10zm0JLqFMM= +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.67.0 h1:ii15t0O+3Mu7uI3Te5X5BIqYXi1V7ovtSIYi5LyiltU= github.com/essentialkaos/ek/v12 v12.67.0/go.mod h1:sRgw+F7PeeoNsmLLVMKy5ccugwGSljk8/rTXC9dyT+M= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= golang.org/x/sys v0.8.0 h1:EBmGv8NaZBZTWvrbjNoL6HVt+IVy3QDQpJs7VRIw3tU= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=