public DashboardCommandHandler(ICommandParser <DashboardCommand> parser, IMessageFactory messageFactory,
                                       ICommandHelpProvider helpProvider, ILogManager logManager, ObjectPool <StringBuilder> sbPool,
                                       HttpServer server, IPasswordFile passwordFile)
        {
            _parser         = parser;
            _messageFactory = messageFactory;
            _helpProvider   = helpProvider;
            _logManager     = logManager;
            _sbPool         = sbPool;
            _server         = server;
            _passwords      = passwordFile.Passwords.Select(p => p.Key).ToArray();

            _parser.Register(new DashboardCommand(HelpRequested, "/help", "lists commands. Usage: /help to show commands, /help [command].", 1, 0));
            _parser.Register(new DashboardCommand(FetchLogRequested, "/fetch-log",
                                                  "fetches log with the name obtained from /logs. Usage: /fetch-log [name]", 1, 1));
            _parser.Register(new DashboardCommand(ListLogsRequested, "/logs", "lists logs", 0, 0));
            _parser.Register(new DashboardCommand(LogSizeRequested, "/logsize", "shows the space used by the logs", 0, 0));
        }
 public void AddCommand(DashboardCommand command)
 {
     _parser.Register(command);
 }