25 string? WorkingDirectory =
null,
26 IReadOnlyDictionary<string, string>? EnvironmentVariables =
null,
28 bool? LogOutput =
null,
29 bool? LogInvocation =
null,
30 Action<OutputType, string>? Logger =
null,
31 Action<IProcess>? ExitHandler = null
50 var timeOut = Math.Max(a?.Timeout ?? -1, b?.Timeout ?? -1);
53 new [] {a?.Arguments, b?.Arguments}
54 .Where(_ => !
string.IsNullOrWhiteSpace(_))
57 WorkingDirectory =
string.IsNullOrWhiteSpace(b?.WorkingDirectory)
59 : b?.WorkingDirectory,
61 EnvironmentVariables = a?.EnvironmentVariables.Merge(b?.EnvironmentVariables),
63 Timeout = timeOut < 0 ? null : timeOut,
65 LogOutput = (a?.LogOutput ==
null && b?.LogOutput ==
null)
67 : (a?.LogOutput ??
false) || (b?.LogOutput ??
false),
69 LogInvocation = (a?.LogInvocation ==
null && b?.LogInvocation ==
null)
71 : (a?.LogInvocation ??
false) || (b?.LogInvocation ??
false),
73 Logger = a?.Logger + b?.Logger,
75 ExitHandler = a?.ExitHandler + b?.ExitHandler