// ReSharper disable ClassNeverInstantiated.Global namespace TeamCity.CSharpInteractive; using System.Text.RegularExpressions; internal class HelpCommandFactory : ICommandFactory { private static readonly Regex Regex = new(@"^#help\s*$", RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.IgnoreCase); private readonly ILog _log; public HelpCommandFactory(ILog log) => _log = log; public int Order => 0; public IEnumerable Create(string replCommand) { if (!Regex.Match(replCommand).Success) { yield break; } _log.Trace(() => new[] {new Text("REPL help")}); yield return HelpCommand.Shared; } }