Skip to content

Conversation

@Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented May 5, 2025

Closes #79

Example usage:

var cmd = Cli.Wrap(...);

var result = await cmd.ExecuteAsync(
    startInfo =>
    {
        startInfo.RedirectStandardInput = false;
        startInfo.RedirectStandardOutput = false;
        startInfo.RedirectStandardError = false;
        startInfo.CreateNoWindow = false;
    },
    process =>
    {
        process.PriorityBoostEnabled = true;
    }
);

Note that using this overload is reserved for very rare edge cases where you need to break out of CliWrap's abstraction model (such as #79) and configure the low-level process properties/behavior manually. Do not rely on it in the general case.

If something breaks when using this overload, you're on your own.

@Tyrrrz Tyrrrz requested a review from Copilot May 5, 2025 15:01
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new overload for Command.ExecuteAsync that enables direct configuration of the underlying ProcessStartInfo and Process, catering to edge cases where the CliWrap abstraction needs to be bypassed.

  • Introduces a new overload accepting configuration actions for ProcessStartInfo and Process.
  • Retains the previous overload by internally calling the new one with null configuration actions.

@codecov
Copy link

codecov bot commented May 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.03%. Comparing base (9b9384d) to head (79e45dc).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #290      +/-   ##
==========================================
+ Coverage   95.01%   95.03%   +0.02%     
==========================================
  Files          48       48              
  Lines        1203     1208       +5     
  Branches       89       95       +6     
==========================================
+ Hits         1143     1148       +5     
  Misses         37       37              
  Partials       23       23              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Tyrrrz Tyrrrz merged commit 4d0471e into master May 12, 2025
7 checks passed
@Tyrrrz Tyrrrz deleted the no-redirect-execution-model branch May 12, 2025 00:28
hawkeye116477 pushed a commit to hawkeye116477/CliWrap-net462 that referenced this pull request Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Console.OpenStandardInput() does not get properly released after using it as a pipe source

2 participants