- Added an overload for
SetArguments
that takes a list. You can pass multiple arguments and they will be automatically encoded to preserve whitespace and other special characters. - Fixed some typos in documentation.
- Fixed an issue where
ExecuteAndForget
was throwing an exception if the underlying process outlived the execution of the method.
ExitCodeValidationException
andStandardErrorValidationException
now display both exit code and standard error inside the message. Useful when a process reported a non-zero exit code but the actual error message is in stderr.- Removed
netcoreapp1.0
target.
- Added
Cli.Wrap
static method to replacenew Cli()
for a more fluent interface. This also makes it so you're dealing withICli
instead ofCli
throughout the entire method chain. - Standard error validation is now disabled by default. This change was made because quite a few CLIs (e.g. git, ffmpeg) write progress to stderr.
- Changed
Execute
andExecuteAsync
to complete only after the process exits, regardless of cancellation. This fixes a problem where the underlying process could live for some brief moments after those methods returned, in case of cancellation. - If
Execute
orExecuteAsync
is canceled, the underlying process will now be killed without waiting for standard input to write completely. - Reworked underlying process handling to improve performance and maintainability. The
Execute
andExecuteAsync
methods are now virtually the same in terms of code, unlike before, where they were considerably different.
- Added
ExecutionResult
toExitCodeValidationException
andStandardErrorValidationException
. This way additional information can be inspected during debugging. ExitCodeValidationException
andStandardErrorValidationException
are now derived fromExecutionResultValidationException
.- Improved cancellation handling in synchronous workflow.
- Cancellation token is now used when writing stdin in asynchronous workflow.
- Methods that used to return an instance of
Cli
now returnICli
where applicable.
- Re-designed the API so that it follows the builder pattern. Execution parameters are now supplied using chainable methods on the
Cli
instead of viaExecutionInput
. Things likeBufferHandler
andCancellationToken
are now also configured in the same manner. Refer to the readme to see updated usage examples. - It is now also possible to pipe a raw stream to standard input, instead of just a text string.
- Removed
ExecutionInput
,CliSettings
,BufferHandler
,EncodingSettings
. - Renamed
ExecutionOutput
toExecutionResult
. - Removed
ExecutionResult.HasError
andExecutionResult.ThrowIfError()
. - Added an option to automatically throw an exception when the underlying process reports a non-zero exit code. Is enabled by default.
- Added an option to automatically throw an exception when the underlying process writes anything to standard error. Is enabled by default.
- Fixed exception messages not appearing in Visual Studio's exception popup.
StandardErrorException
now shows the value ofStandardError
inMessage
.
- Added
ICli
to aid in testing.
- Made input model classes more accessible by removing immutability.
Cli
now throws exception if used after getting disposed.
- Fixed another process leak when canceling synchronous
Execute
.
- Refactored additional
Cli
constructor parameters into a separate class calledCliSettings
. This is breaking if you used to supply more than 1 parameter to the constructor. Execute
andExecuteAsync
no longer depend on process getting successfully killed. An attempt to kill it is made but if it's not successful, no exception is thrown.- All
CancellationToken
callbacks are now exception-safe. - Fixed an issue where
CancellationToken
would throw an out of scope exception when the process could not be killed. - Fixed a race condition when an execution task is completed and canceled at the same time.
- Added
EncodingSettings
to customize stream encoding. - Added some ReSharper annotations to improve warnings and suggestions.
- Execution start and exit times are now calculated separately, without accessing
Process
instance. - Execution start and exit times are now
DateTimeOffset
instead ofDateTime
. - Fixed an issue that prevented CliWrap from properly working on Linux.