-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: new flag options for cache #204
Conversation
CoverItUp Report
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
cmd/gobrew/main.go
Outdated
_, ok = Find(allowedArgs, os.Args[1]) | ||
if !ok { | ||
return false | ||
for i := range os.Args { |
There was a problem hiding this comment.
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
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
CoverItUp ReportComparison Table - 7 Types 📈
Commits HistoryUpto Users HistoryUpto |
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
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:
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.