diff --git a/Lombiq.HelpfulLibraries.Cli/CliProgram.cs b/Lombiq.HelpfulLibraries.Cli/CliProgram.cs
index 7cb40790..9011a9b4 100644
--- a/Lombiq.HelpfulLibraries.Cli/CliProgram.cs
+++ b/Lombiq.HelpfulLibraries.Cli/CliProgram.cs
@@ -18,6 +18,12 @@ public class CliProgram
public CliProgram(string command) => _command = command + OperatingSystemHelper.GetExecutableExtension();
+ ///
+ /// Creates a object based on the passed .
+ ///
+ public Command GetCommand(params object[] arguments) =>
+ GetCommand(arguments.ToList());
+
///
/// Creates a object based on the passed .
///
@@ -70,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.
diff --git a/Lombiq.HelpfulLibraries.Common/Extensions/StringExtensions.cs b/Lombiq.HelpfulLibraries.Common/Extensions/StringExtensions.cs
index e26def64..98cf0b8b 100644
--- a/Lombiq.HelpfulLibraries.Common/Extensions/StringExtensions.cs
+++ b/Lombiq.HelpfulLibraries.Common/Extensions/StringExtensions.cs
@@ -130,14 +130,15 @@ public static string ReplaceOrdinalIgnoreCase(this string text, string oldValue,
text.Replace(oldValue, newValue ?? string.Empty, StringComparison.OrdinalIgnoreCase);
///
- /// A shortcut for string.Equals(string, StringComparison.Ordinal).
+ /// Use simple equality check with = instead, since it already uses ordinal string
+ /// comparison.
///
[Obsolete("The string equals operator already uses ordinal string comparison.")]
public static bool EqualsOrdinal(this string text, string? value) =>
throw new NotSupportedException();
///
- /// A shortcut for string.Contains(string, StringComparison.Ordinal).
+ /// Use string.Contains(string) instead, since it already uses ordinal string comparison..
///
[Obsolete("The string.Contains(value) member method already uses ordinal string comparison.")]
public static bool ContainsOrdinal(this string text, string value) =>
@@ -168,7 +169,7 @@ public static bool EndsWithOrdinal(this string text, string value) =>
text.EndsWith(value, StringComparison.Ordinal);
///
- /// A shortcut for string.Replace(string, string, StringComparison.Ordinal).
+ /// Use string.Replace(string, string) instead, since it already uses ordinal string comparison..
///
[Obsolete("The string.Replace(oldValue, newValue) member method already uses ordinal string comparison.")]
public static string ReplaceOrdinal(this string text, string oldValue, string? newValue = "") =>