mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Allow wildcards in help command args
Supports the help command for *status, all modules that are using CModCommand as appropriate, and *controlpanel get/set variables.
This commit is contained in:
@@ -570,14 +570,15 @@ bool CModule::HandleCommand(const CString& sLine) {
|
||||
}
|
||||
|
||||
void CModule::HandleHelpCommand(const CString& sLine) {
|
||||
CString sFilter = sLine.Token(1);
|
||||
CString sFilter = sLine.Token(1).AsLower();
|
||||
CString::size_type iFilterLength = sFilter.size();
|
||||
CTable Table;
|
||||
map<CString, CModCommand>::const_iterator it;
|
||||
|
||||
CModCommand::InitHelp(Table);
|
||||
for (it = m_mCommands.begin(); it != m_mCommands.end(); ++it) {
|
||||
if (sFilter.empty() || (it->second.GetCommand().Equals(sFilter, false, iFilterLength))) {
|
||||
CString sCmd = it->second.GetCommand().AsLower();
|
||||
if (sFilter.empty() || (sCmd.Equals(sFilter, true, iFilterLength)) || sCmd.WildCmp(sFilter)) {
|
||||
it->second.AddHelp(Table);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user