Binboo.Core.Commands.HelpCommand.Process C# (CSharp) Method

Process() public method

public Process ( IContext context ) : ICommandResult
context IContext
return ICommandResult
        public override ICommandResult Process(IContext context)
        {
            IDictionary<string, Argument> arguments = CollectAndValidateArguments(context.Arguments, cmd => ParamValidator.Anything.AsOptional());
            var helpMsg = new StringBuilder("Command        Description" + Environment.NewLine +
               	                                        "-------        -----------" + Environment.NewLine + Environment.NewLine);

            foreach(IBotCommand command in HelpFor(arguments["cmd"]))
            {
                helpMsg.AppendFormat("{0,-15}{1}{2}{2}", command.Id, AddTabAtNewLine(command.Help), Environment.NewLine);
            }

            return CommandResult.Success(helpMsg.ToString());
        }