mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-26 11:51:17 +08:00
27 lines
585 B
C#
27 lines
585 B
C#
using System;
|
|
|
|
namespace SourceGit
|
|
{
|
|
public static class StringExtensions
|
|
{
|
|
public static string Quoted(this string value)
|
|
{
|
|
return $"\"{Escaped(value)}\"";
|
|
}
|
|
|
|
public static string Escaped(this string value)
|
|
{
|
|
return value.Replace("\"", "\\\"", StringComparison.Ordinal);
|
|
}
|
|
}
|
|
|
|
public static class CommandExtensions
|
|
{
|
|
public static T Use<T>(this T cmd, Models.ICommandLog log) where T : Commands.Command
|
|
{
|
|
cmd.Log = log;
|
|
return cmd;
|
|
}
|
|
}
|
|
}
|