-
Notifications
You must be signed in to change notification settings - Fork 136
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
Add support for command args with JSON Array #38
Conversation
cf18933
to
5b5b1c3
Compare
- Refactor getCmd into argsToCmd and strToCmd - Add *Cmd parameters to all config structs - Add parseCommandArgs function which supports JSON array or JSON string - Do parsing of all commands once - during loadConfig() - Update README
9e4160a
to
bd9ef3e
Compare
} | ||
} | ||
|
||
func getCmd(args []string) *exec.Cmd { | ||
func argsToCmd(args []string) *exec.Cmd { |
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 feel like argsToCmd
and strToCmd
should be moved into config.go now, just because all but one of their callers are in config.go.
I like the approach here. Just a few comments to fix I think. |
- If JSON is not provided, return an empty string form parseInterfaces to prevent future null-ref problems
- Convert errors.New(fmt.Sprintf()) into fmt.Errorf() - Break up long lines using the former convention
@tgross I agree with and have addressed your comments. |
LGTM! Merging! |
Add support for command args with JSON Array
See README.md for a better description
For #37