Skip to content
Snippets Groups Projects
  1. Oct 27, 2017
    • Michael Aaron Murphy's avatar
    • Michael Aaron Murphy's avatar
      Better Builtin Map Macro Syntax · fd3bef2f
      Michael Aaron Murphy authored
      fd3bef2f
    • Michael Aaron Murphy's avatar
    • Michael Aaron Murphy's avatar
      Re-apply rustfmt · de27cd07
      Michael Aaron Murphy authored
      de27cd07
    • Michael Aaron Murphy's avatar
      Simply & Improve Stream Dup/Redir Logic · 5514bef9
      Michael Aaron Murphy authored
      Rather than returning raw fds, we will return Files
      5514bef9
    • Christopher Vittal's avatar
      Implement Multiple Redirections (#553) · 6eaded0f
      Christopher Vittal authored and Michael Aaron Murphy's avatar Michael Aaron Murphy committed
      Add multiple redirections, that is, support for things like:
      
      ```
      cmd <file1 <file2 ^>> err-log > output | cmd2
      ```
      In current ion this doesn't work.
      
      This change at current would be breaking as the statement:
      ```
      tr 'x' 'y' | tr 'y' 'z' < file > file2
      ```
      redirects `file` to the first `tr` command. With this change, we would redirect it to the second.
      
      ## Overview
      We treat a multiple redirection as it's own job. The only difference between these jobs and normal jobs is that they only read from their source(s) and then write to their sink(s).
      
      ### Parsing
      Alter `Pipline` contain a vector of `PipeItem`s. A `PipeItem` consists of a `Job`, a `Vec<Redirection>` and a `Vec<Input>`. The above statement would be parsed into two items, `cmd` together with `[file1, file2]` as input and `[err-log, output]` as outputs, and `cmd2` with no `Input`s or `Redirection`s
      
      ### Command Generation and Redirection Setup
      Added two two new variants of `RefinedJob`, `Cat` and `Tee`, `Cat` for concatenating multiple inputs, `Tee` for splitting multiple outputs. Alter the `generate_commands` function to return a `Vec<(RefinedJob, JobKind, Vec<Redirection>, Vec<Input>)>`, then condense `redirect_input` and `redirect_output` into one function that takes ownership and returns a new `Vec<(RefinedJob, JobKind)>`. It is here that we create the `Tee` and `Cat` jobs that we need and put them in the right spot in the pipeline.
      
      ### Execution
      Add `exec_multi_in` and `exec_multi_out` to handle the multiple redirections. These are fairly straightforward, they just read their sources and write to their sinks. I didn't add any extra paths to `exec_job` as the new `RefinedJob` kinds are always part of a pipeline.
      6eaded0f
  2. Oct 26, 2017
  3. Oct 20, 2017
  4. Oct 13, 2017
  5. Oct 12, 2017
  6. Oct 11, 2017
  7. Oct 10, 2017
  8. Oct 09, 2017
  9. Oct 08, 2017
  10. Oct 07, 2017
  11. Oct 06, 2017
Loading