Пример #1
0
        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());
        }
Пример #2
0
        private string ReplaceHelpCommand(Match match)
        {
            string            help    = match.Value.TrimEnd();
            AnsiStringBuilder builder = new AnsiStringBuilder();

            builder.AppendLink(help, ActionBuilder.InputSetUri(help));
            return(builder.ToString());
        }
Пример #3
0
        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());
        }
Пример #4
0
        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()));
        }