Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
mayuki committed Sep 13, 2021
1 parent 2d83d7a commit d285d02
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/Chell/Run.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,60 @@

namespace Chell
{
/// <summary>
/// Short cut for <see cref="ProcessTask"/> to launch a process from a <see cref="string"/> or <see cref="FormattableString"/>.
/// </summary>
public class Run : ProcessTask
{
public static implicit operator Run(FormattableString commandLine)
=> new Run(commandLine);
public static implicit operator Run(CommandLineString commandLine)
=> new Run(commandLine);

/// <summary>
/// Launches a process from a <see cref="string"/>.
/// </summary>
/// <param name="commandLine"></param>
public Run(CommandLineString commandLine) : base(commandLine) { }

/// <summary>
/// Launches a process from a <see cref="FormattableString"/>.
/// </summary>
/// <remarks>
/// The interpolated string will be escaped and the array will be expanded.
/// </remarks>
public Run(FormattableString commandLine) : base(commandLine) { }

/// <summary>
/// Launches a process from a <see cref="string"/> and connects the specified <see cref="Stream"/> to the standard input.
/// </summary>
public Run(Stream inputStream, CommandLineString commandLine) : base(inputStream, commandLine) { }

/// <summary>
/// Launches a process from a <see cref="FormattableString"/> and connects the specified <see cref="Stream"/> to the standard input.
/// </summary>
/// <remarks>
/// The interpolated string will be escaped and the array will be expanded.
/// </remarks>
/// <param name="inputStream"></param>
/// <param name="commandLine"></param>
public Run(Stream inputStream, FormattableString commandLine) : base(inputStream, commandLine) { }

/// <summary>
/// Launches a process from a <see cref="string"/> and writes the specified binary data to the standard input.
/// </summary>
/// <param name="inputData"></param>
/// <param name="commandLine"></param>
public Run(ReadOnlyMemory<byte> inputData, CommandLineString commandLine) : base(new MemoryStream(inputData.ToArray()), commandLine) { }

/// <summary>
/// Launches a process from a <see cref="FormattableString"/> and writes the specified binary data to the standard input.
/// </summary>
/// <remarks>
/// The interpolated string will be escaped and the array will be expanded.
/// </remarks>
/// <param name="inputData"></param>
/// <param name="commandLine"></param>
public Run(ReadOnlyMemory<byte> inputData, FormattableString commandLine) : base(new MemoryStream(inputData.ToArray()), commandLine) { }
}
}

0 comments on commit d285d02

Please sign in to comment.