mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02: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:
@@ -51,7 +51,7 @@ class CAdminMod : public CModule {
|
||||
const CString sCmdFilter = sLine.Token(1, false);
|
||||
const CString::size_type iCmdLength = sCmdFilter.size();
|
||||
|
||||
const CString sVarFilter = sLine.Token(2, true);
|
||||
const CString sVarFilter = sLine.Token(2, true).AsLower();
|
||||
const CString::size_type iVarLength = sVarFilter.size();
|
||||
|
||||
if (sCmdFilter.empty() || sCmdFilter.Equals("Set", false, iCmdLength) || sCmdFilter.Equals("Get", false, iCmdLength)) {
|
||||
@@ -89,7 +89,8 @@ class CAdminMod : public CModule {
|
||||
#endif
|
||||
};
|
||||
for (unsigned int i = 0; i != ARRAY_SIZE(vars); ++i) {
|
||||
if (sVarFilter.empty() || sVarFilter.Equals(vars[i][0], false, iVarLength)) {
|
||||
CString sVar = CString(vars[i][0]).AsLower();
|
||||
if (sVarFilter.empty() || sVarFilter.Equals(sVar, true, iVarLength) || sVar.WildCmp(sVarFilter)) {
|
||||
VarTable.AddRow();
|
||||
VarTable.SetCell("Variable", vars[i][0]);
|
||||
VarTable.SetCell("Type", vars[i][1]);
|
||||
@@ -118,7 +119,8 @@ class CAdminMod : public CModule {
|
||||
#endif
|
||||
};
|
||||
for (unsigned int i = 0; i != ARRAY_SIZE(nvars); ++i) {
|
||||
if (sVarFilter.empty() || sVarFilter.Equals(nvars[i][0], false, iVarLength)) {
|
||||
CString sVar = CString(nvars[i][0]).AsLower();
|
||||
if (sVarFilter.empty() || sVarFilter.Equals(sVar, true, iVarLength) || sVar.WildCmp(sVarFilter)) {
|
||||
NVarTable.AddRow();
|
||||
NVarTable.SetCell("Variable", nvars[i][0]);
|
||||
NVarTable.SetCell("Type", nvars[i][1]);
|
||||
@@ -143,7 +145,8 @@ class CAdminMod : public CModule {
|
||||
{"Detached", boolean}
|
||||
};
|
||||
for (unsigned int i = 0; i != ARRAY_SIZE(cvars); ++i) {
|
||||
if (sVarFilter.empty() || sVarFilter.Equals(cvars[i][0], false, iVarLength)) {
|
||||
CString sVar = CString(cvars[i][0]).AsLower();
|
||||
if (sVarFilter.empty() || sVarFilter.Equals(sVar, true, iVarLength) || sVar.WildCmp(sVarFilter)) {
|
||||
CVarTable.AddRow();
|
||||
CVarTable.SetCell("Variable", cvars[i][0]);
|
||||
CVarTable.SetCell("Type", cvars[i][1]);
|
||||
|
||||
Reference in New Issue
Block a user