private string ReplaceBranchName(Match match) { AnsiStringBuilder builder = new AnsiStringBuilder(); string helpCommand = $"git checkout {match.Value}"; builder.AppendLink(match.Value, ActionBuilder.InputSetUri(helpCommand)); return(builder.ToString()); }
private string ReplaceHelpCommand(Match match) { string help = match.Value.TrimEnd(); AnsiStringBuilder builder = new AnsiStringBuilder(); builder.AppendLink(help, ActionBuilder.InputSetUri(help)); return(builder.ToString()); }
private string ReplaceHelpWithAction(Match match) { AnsiStringBuilder builder = new AnsiStringBuilder(); builder.Append("\""); string helpCommand = match.Groups["help"].Value; builder.AppendLink(helpCommand, ActionBuilder.InputSetUri(helpCommand)); builder.Append("\""); return(builder.ToString()); }
public ICommandResult Execute(CommandContext context) { AnsiStringBuilder result = new AnsiStringBuilder(); foreach (IHistoryItem historyItem in history.GetHistory()) { string rawInput = historyItem.Input.ParsedInput.RawInput; result.AppendLink(rawInput, ActionBuilder.InputSetUri(rawInput)); result.AppendLine(); } return(new TextResult(result.ToString())); }