waf / CSharpRepl

A command line C# REPL with syntax highlighting – explore the language, libraries and nuget packages interactively.
https://fuqua.io/CSharpRepl/
Mozilla Public License 2.0
2.92k stars 113 forks source link

Initial support for evaluating piped input from stdin #284

Closed waf closed 1 year ago

waf commented 1 year ago

Adds support for csharprepl to evaluate piped input. By default, it reads all input available and then executes it.

Alternatively, there's a --streamPipedInput flag that instructs csharprepl to evaluate the input in a streaming mode, so it reads line by line and evaluates complete statements.

codecov[bot] commented 1 year ago

Codecov Report

Merging #284 (8d31188) into main (e1c49d5) will decrease coverage by 0.1%. The diff coverage is 63.6%.

@@           Coverage Diff           @@
##            main    #284     +/-   ##
=======================================
- Coverage   77.4%   77.4%   -0.1%     
=======================================
  Files         81      82      +1     
  Lines       5484    5545     +61     
  Branches     720     729      +9     
=======================================
+ Hits        4246    4293     +47     
- Misses       972     985     +13     
- Partials     266     267      +1     
Impacted Files Coverage Δ
CSharpRepl.Services/IConsoleEx.cs 32.5% <ø> (ø)
CSharpRepl.Services/SystemConsoleEx.cs 20.0% <0.0%> (-2.3%) :arrow_down:
CSharpRepl/Program.cs 32.9% <0.0%> (-4.1%) :arrow_down:
CSharpRepl/PipedInputEvaluator.cs 72.5% <72.5%> (ø)
CSharpRepl.Services/Configuration.cs 85.8% <100.0%> (+4.6%) :arrow_up:
CSharpRepl/CommandLine.cs 94.5% <100.0%> (+0.1%) :arrow_up:
CSharpRepl/ReadEvalPrintLoop.cs 90.7% <100.0%> (ø)