-
Notifications
You must be signed in to change notification settings - Fork 42
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
Allow passing multiple --input-file
s to workflow commands [#351]
#361
Conversation
The documentation for how to pass multiple arguments was just wrong--`json.Unmarshal()` does not support parsing multi-line JSON inputs as separate values. Fix this by accepting multiple `--input-file` flags, parsing each one separately, and turning each file into a distinct argument. Also, check and throw an error if the user tries to use both `--input` and `--input-file`, since the old behavior--silently ignoring `--input` if `--input-file` is specified--was surprising.
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.
LGTM!
|
||
s.Assert().Equal("[1,\"two\",{\"three\":3},[\"a\",\"b\",\"c\"]]", result) | ||
} | ||
|
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.
This isn't blocking, but just noting that running a real workflow to completion involves quite a lot of machinery that's not related to argument handling. It might be nice to come up with a more directed way to do this.
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 agree; there are a lot of ways to handle this (e.g. checking the workflow arguments server-side without waiting for completion, mocking out parts of the CLI so we don't even need a server, etc.). This was just the most expedient.
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.
Added a couple tiny Go tips for future
Chad gave me a few style suggestions after I merged #361--this applies those style suggestions.
Chad gave me a few style suggestions after I merged #361--this applies those style suggestions.
The documentation for how to pass multiple arguments was just wrong--
json.Unmarshal()
does not support parsing multi-line JSON inputs as separate values.Fix this by accepting multiple
--input-file
flags, parsing each one separately, and turning each file into a distinct argument.Also, check and throw an error if the user tries to use both
--input
and--input-file
, since the old behavior--silently ignoring--input
if--input-file
is specified--was surprising.