[WIP] Add support for herestrings
Created by: huntergoldstein
Changes introduced by this pull request:
- Modified
Pipeline::stdin
's type to be a union of either a filename or a string input - Added support in
pipelines::Collector
for recognizing herestrings - Added required functionality in
Shell::execute_pipeline
TODOs:
-
Outstanding Bug: running tr '[a-z]' '[A-Z]' <<< "foo"
produces no output -
Add doc comments for the peg::Input
enum -
Add regression tests in pipelines.rs
and integration tests inexamples/
for herestrings
Fixes: Closes #133 (closed)
State: WIP; see TODOs.
Other: This PR ended up being slightly different than #200; instead of holding onto the string and writing to stdin
once the command had been spawned, this takes a cue from the implementation of &|
: write the herestring to a pipe, close the writer end, and pass the reader end to the first command in the pipeline.