Skip to content

v0.6.0-rc8: Add WithStandardInput() to Shell.Run()

Pre-release
Pre-release

Choose a tag to compare

@StevenTCramer StevenTCramer released this 17 Jul 03:25
· 726 commits to master since this release

What's New in v0.6.0-rc8

✨ New Features

  • WithStandardInput() - Added the ability to provide standard input to commands using the fluent builder API

πŸ“ Usage Example

// Provide standard input to commands
var grepResult = await Shell.Run("grep")
    .WithArguments("pattern")
    .WithStandardInput("line1\nline2 with pattern\nline3")
    .GetStringAsync();

// Combine with pipelines
var sorted = await Shell.Run("sort")
    .WithStandardInput("banana\napple\ncherry")
    .Pipe("head", "-2")
    .GetLinesAsync();

πŸ”§ Technical Details

  • Added WithStandardInput(string input) method to RunBuilder
  • Updated CommandExtensions.Run() to accept optional standardInput parameter
  • Uses CliWrap's WithStandardInputPipe() under the hood
  • Full test coverage for various stdin scenarios

Full Changelog: v0.6.0-rc7...v0.6.0-rc8