Files
duplicati/Duplicati/CommandLine/ServerUtil/CommandExtensions.cs
T
Kenneth Skovhede 735b4020eb Implemented duplicati-server-util for sending various commands to a running server.
This tool replaces `ConfigurationImporter` and partially replaces `duplicati_client`.
This fixes #5474
2024-08-26 20:00:13 +02:00

23 lines
679 B
C#

using System.CommandLine;
using System.CommandLine.Invocation;
namespace Duplicati.CommandLine.ServerUtil;
/// <summary>
/// Extensions for <see cref="Command"/>.
/// </summary>
public static class CommandExtensions
{
/// <summary>
/// Adds the missing WithHandler method to <see cref="Command"/>.
/// </summary>
/// <param name="command">The command to add the handler to.</param>
/// <param name="handler">The handler to add.</param>
/// <returns>The command with the handler added.</returns>
public static Command WithHandler(this Command command, ICommandHandler handler)
{
command.Handler = handler;
return command;
}
}