diff --git a/Lombiq.HelpfulLibraries.Cli/CliProgram.cs b/Lombiq.HelpfulLibraries.Cli/CliProgram.cs index 41b31046..9011a9b4 100644 --- a/Lombiq.HelpfulLibraries.Cli/CliProgram.cs +++ b/Lombiq.HelpfulLibraries.Cli/CliProgram.cs @@ -76,6 +76,27 @@ public async Task ExecuteAsync( public Task ExecuteAsync(CancellationToken token, params object[] arguments) => ExecuteAsync(arguments, additionalExceptionText: null, token); + /// + /// Calls the command specified in the constructor with the provided arguments, and returns the standard output as a + /// string. If the process doesn't succeed or outputs to the standard error stream then an exception is thrown. + /// + /// Passed into the CliWrap . + /// + /// The arguments passed to the command. If an item is not a , then it's converted using the + /// formatter. + /// + /// The standard output as a string. + /// + /// Thrown if the command fails or outputs to the error stream. The format is like this: + /// + /// The {command} {arguments} command failed with the output below. + /// {additional exception text} + /// {standard error output} + /// + /// + public Task ExecuteAndGetOutputAsync(CancellationToken token, params object[] arguments) => + ExecuteAndGetOutputAsync(arguments, additionalExceptionText: null, token); + /// /// Calls the command specified in the constructor with the provided arguments, and returns the standard output as a /// string. If the process doesn't succeed or outputs to the standard error stream then an exception is thrown.