Closed MindSwipe closed 1 year ago
Why not do this?
var command = Cli.Wrap("ping").WithArguments(args =>
{
args.Add("-t");
if (_options.UseIPV6)
args.Add("-6");
});
The builder overload was made specifically for these type of scenarios.
Going to close this issue, since the above suggestion should satisfy the highlighted use case. Let me know if there's another scenario where you'd need to extend arguments of an existing command.
Details
Currently calling
WithArguments
returns a new command where any potential arguments already added are cleared, for example when doing:Results in the command
The current workaround is to do something like this:
which is a little cumbersome.