add --input (-i) flag for passing inputs on stdin
#147
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Inputs can be passed as key-value pairs fed as JSON on
*stdin*. Paths are parsed into host paths, which must start with./or/regardless of your local platform's slash preferences.This approach should let us get pretty far without having to implement full-blown flag parsing where we'd also have to figure out how to represent rich objects like thunk paths in someplace that only takes strings. Here we can just encode them as JSON.
I think passing objects on stdin is generally preferable to flags/argv in an automation scenario, but it sucks for interactive use (no one wants to type JSON), hence
--input/-ifor passing values instead. This approach maximizes reusability of scripts between interactive dev shells, CI hooks, and/or being called from other Bass scripts:Someday we could support omitting the braces for keyword arg like UX.