Skip to content

feat: new flag options for cache#204

Merged
kevincobain2000 merged 7 commits intomasterfrom
feature/202-flags-for-cache
Sep 5, 2024
Merged

feat: new flag options for cache#204
kevincobain2000 merged 7 commits intomasterfrom
feature/202-flags-for-cache

Conversation

@juev
Copy link
Collaborator

@juev juev commented Sep 3, 2024

Fixed: #202

To implement the gobrew option, I had to use a third-party library called pflag.

Why? Because it handles positional arguments and flags properly.

For example:
If we use the standard flag, then

gobrew ls -h

will call the ls command.

While in pflag the help will be called. Since this option was used.
A number of options have been added to the gobrew configuration. To manage the cache:

  • TTL
  • DisableCache
  • ClearCache

I also had to fix the behavior of the check for unavailable flags. We had an error in the check there.

And I slightly corrected the Find function. We used only one variable from the function output.

I checked locally a number of cases of using flags and options, launched in debug mode in order to check the correctness of filling the configuration. Everything seemed to be correct and without errors.

Maybe it's worth adding unit tests for these cases? I honestly don't really understand how to implement this yet.

@juev juev self-assigned this Sep 3, 2024
@github-actions
Copy link

github-actions bot commented Sep 3, 2024

CoverItUp Report

Type master feature/202-flags-for-cache edeeff9 from 4bbbb55
coverage 60.5% 59% 📉
build-time 0sec 0sec
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto 4bbbb55 for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto 4bbbb55 for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

@github-actions
Copy link

github-actions bot commented Sep 3, 2024

CoverItUp Report

Comparison Table - 7 Types 📈
Type master feature/202-flags-for-cache edeeff9 from f644f2a
coverage 60.5% 59% 📉
build-time 0sec 1sec 📈
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto f644f2a for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto f644f2a for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

_, ok = Find(allowedArgs, os.Args[1])
if !ok {
return false
for i := range os.Args {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another thing, after switching to using a loop for checking, there is a problem with the command sequence. And such a sequence will be correct:

go run ./cmd/gobrew latest use

I'll fix it

@github-actions
Copy link

github-actions bot commented Sep 4, 2024

CoverItUp Report

Comparison Table - 7 Types 📈
Type master feature/202-flags-for-cache edeeff9 from 971e555
coverage 60.5% 60.5%
build-time 0sec 1sec 📈
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto 971e555 for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto 971e555 for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

@github-actions
Copy link

github-actions bot commented Sep 4, 2024

CoverItUp Report

Comparison Table - 7 Types 📈
Type master feature/202-flags-for-cache edeeff9 from 5e4242d
coverage 60.5% 60.5%
build-time 0sec 0sec
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto 5e4242d for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto 5e4242d for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

@github-actions
Copy link

github-actions bot commented Sep 4, 2024

CoverItUp Report

Comparison Table - 7 Types 📈
Type master feature/202-flags-for-cache edeeff9 from 02b9846
coverage 60.5% 60.1% 📉
build-time 0sec 0sec
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto 02b9846 for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto 02b9846 for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

@github-actions
Copy link

github-actions bot commented Sep 4, 2024

CoverItUp Report

Comparison Table - 7 Types 📈
Type master feature/202-flags-for-cache edeeff9 from 7c39b7f
coverage 60.5% 60.7% 📈
build-time 0sec 1sec 📈
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto 7c39b7f for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto 7c39b7f for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

@kevincobain2000 kevincobain2000 merged commit 7ffc9d7 into master Sep 5, 2024
@kevincobain2000 kevincobain2000 deleted the feature/202-flags-for-cache branch September 5, 2024 01:33
@github-actions
Copy link

github-actions bot commented Sep 5, 2024

CoverItUp Report

Comparison Table - 7 Types 📈
Type master feature/202-flags-for-cache edeeff9 from b4d8812
coverage 60.5% 60.7% 📈
build-time 0sec 0sec
go-binary-size 9.6kKB 9.7kKB 📈
go-mod-dependencies 28 29 📈
go-sec-issues 11 10 📉
unit-test-run-time 20sec 20sec
allocs-per-op 18.5kalloc 19.5kalloc 📈
Comparisons Chart - master from feature/202-flags-for-cache

base vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branchbase vs branch

Commits History

Upto b4d8812 for #204
commit historycommit historycommit historycommit historycommit historycommit historycommit history

Users History

Upto b4d8812 for #204
user historyuser historyuser historyuser historyuser historyuser historyuser history

Embed README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Configuration for cache

2 participants