A shared API between CliWrap and RawCli that enables the creation of commands that can be executed by either library.
var command = Commander.Wrap("docker")
.WithArguments(a => a
.Add("build")
.Add("--progress")
.Add("auto"));
// Docker will build with progress=plain since TTY is not supported when output is redirected.
BufferedCommandResult bufferedResult = command.ToCliWrap()
.ExecuteBuffered();
// Docker will build with progress=tty since the output is not redirected.
CommandResult result = command.ToRawCli()
.Execute();
CliCommander contains the .When
helper method for conditional modification of commands:
public void Execute(bool shouldThrowOnExitCode)
{
await Commander.Wrap("docker")
.When(!shouldThrowOnExitCode, c => c.WithValidation(CommandResultValidation.None))
...
}
A fork of CliWrap that enables outputting native process output at the cost of output redirection.
The point of Rawcli
is to support the following use case: Tyrrrz#199 without having to use the raw Process
object.
CommandResult result = Raw.CliWrap("docker")
.WithArguments(a => a
.Add("build")
.Add("--progress")
.Add("tty"))
.Execute();
Standard input redirection is still enabled by default. It can be disabled with: .WithStandardInputRedirect(false)