Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
Related to #145
  • Loading branch information
Tyrrrz authored Apr 16, 2022
1 parent aeb93a8 commit 2453b20
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CliWrap.Tests.Dummy/Commands/SleepCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public class SleepCommand : ICommand

public async ValueTask ExecuteAsync(IConsole console)
{
await console.Output.WriteLineAsync($"Sleeping for {Duration}...");
await Task.Delay(Duration);
await console.Output.WriteLineAsync("Done.");
}
}
2 changes: 1 addition & 1 deletion CliWrap/PipeSource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public partial class PipeSource
{
/// <summary>
/// Pipe source that does not provide any data.
/// Logical equivalent to <code>/dev/null</code>.
/// Logical equivalent to /dev/null.
/// </summary>
public static PipeSource Null { get; } = new NullPipeSource();

Expand Down
12 changes: 10 additions & 2 deletions CliWrap/PipeTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,16 @@ public partial class PipeTarget
{
/// <summary>
/// Pipe target that discards all data.
/// Logical equivalent to <code>/dev/null</code>.
/// Logical equivalent to /dev/null.
/// </summary>
/// <remarks>
/// Using this target results in the corresponding stream (stdout or stderr) not being opened for the underlying
/// process at all. In most cases, this behavior should be functionally equivalent to writing to a null stream,
/// but without the performance overhad of discarding unneeded data.
/// This may cause issues in some situations, however, for example if the process attempts to write data to the
/// destination stream without first checking if it's open.
/// In such cases, it may be better to use <see cref="ToStream(Stream)" /> with <see cref="Stream.Null" /> instead.
/// </remarks>
public static PipeTarget Null { get; } = new NullPipeTarget();

/// <summary>
Expand Down Expand Up @@ -136,7 +144,7 @@ static IReadOnlyList<PipeTarget> OptimizeTargets(IEnumerable<PipeTarget> targets
/// <summary>
/// Creates a pipe target that replicates data over multiple inner targets.
/// </summary>
public static PipeTarget Merge(params PipeTarget[] targets) => Merge((IEnumerable<PipeTarget>) targets);
public static PipeTarget Merge(params PipeTarget[] targets) => Merge((IEnumerable<PipeTarget>)targets);
}

internal class NullPipeTarget : PipeTarget
Expand Down

0 comments on commit 2453b20

Please sign in to comment.