Merge pull request #1662 from girst/listify-tables

listify two-column tables
This commit is contained in:
Alexey Sokolov
2019-06-21 21:52:29 +01:00
committed by GitHub
12 changed files with 28 additions and 1 deletions

View File

@@ -2019,13 +2019,15 @@ CModCommand::CModCommand(const CString& sCmd, CmdFunc func,
: m_sCmd(sCmd), m_pFunc(std::move(func)), m_Args(Args), m_Desc(Desc) {}
void CModCommand::InitHelp(CTable& Table) {
Table.SetStyle(CTable::ListStyle);
Table.AddColumn(t_s("Command", "modhelpcmd"));
Table.AddColumn(t_s("Description", "modhelpcmd"));
}
void CModCommand::AddHelp(CTable& Table) const {
Table.AddRow();
Table.SetCell(t_s("Command", "modhelpcmd"), GetCommand() + " " + GetArgs());
Table.SetCell(t_s("Command", "modhelpcmd"),
GetCommand() + (GetArgs().empty() ? "" : " ") + GetArgs());
Table.SetCell(t_s("Description", "modhelpcmd"), GetDescription());
}