-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix bug when no unmanaged args were given #59
Conversation
Also added tests for the CLI argument parsing logic + aliases
@@ -297,6 +147,3 @@ func validateVersion(version string) bool { | |||
|
|||
func printError(format string, args ...interface{}) { ErrPrintln(errorString(format, args...)) } | |||
func printWarning(format string, args ...interface{}) { ErrPrintln(warningString(format, args...)) } | |||
|
|||
var warningString = color.New(color.FgYellow).SprintfFunc() |
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.
Moved up with the other vars
link := color.New(color.FgHiBlue, color.Italic).SprintfFunc() | ||
bold := color.New(color.Bold).SprintfFunc() | ||
|
||
descriptionTemplate.Execute(&descriptionBuffer, map[string]interface{}{ |
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.
moved to cli.go
|
||
// Environment variables | ||
const ( |
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.
moved to cli.go
arguments.go
Outdated
@@ -1,120 +0,0 @@ | |||
package main |
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.
moved to cli.go
go.mod
Outdated
@@ -12,7 +12,7 @@ require ( | |||
github.com/aws/aws-sdk-go v1.16.12 | |||
github.com/blang/semver v0.0.0-20180723201105-3c1074078d32 | |||
github.com/cheekybits/is v0.0.0-20150225183255-68e9c0620927 // indirect | |||
github.com/coveo/gotemplate v2.7.6+incompatible // indirect | |||
github.com/coveo/gotemplate v2.7.6+incompatible |
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.
Not supposed to be here.
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.
gotemplate or this modification?
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.
OK, it is because terragrunt is not still updated to go modules
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.
I mean the v2.7.6+incompatible ...
Pull Request Test Coverage Report for Build 782
💛 - Coveralls |
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.
I did some refactoring on your refactoring
cli.go
Outdated
@@ -240,20 +244,20 @@ func (app *ApplicationArguments) parseArguments() (*CliOptions, []string) { | |||
if extraArgs, ok := os.LookupEnv(envArgs); ok { | |||
os.Args = append(os.Args, strings.Split(extraArgs, " ")...) | |||
} | |||
managed, unmanaged := app.SplitManaged(os.Args) | |||
must(app.Parse(managed)) | |||
app.managedArgs, app.unmanagedArgs = app.SplitManaged(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.
The SplitManaged should then modify directly the parameters.
You should instead override the Parse method. I'll do it in your branch.
Nice! Ready to merge? |
It is up to you now. |
I'll merge it but not release 1.20.0 now. I may have some other fixes to do. My functional tests are still not working, but I'm making progress |
Reworked the CLI arguments structure. Some were function specific, some were global, it was weird. Now all are global and contained within a class. Ideally, it wouldn't be global and it would be passed around but that would require too many modifications for now. Maybe another time.
Also added tests for the CLI argument parsing logic + aliases