1
0
mirror of https://github.com/anope/anope.git synced 2026-07-04 09:03:12 +02:00

Made the help command description code more sane

This commit is contained in:
Adam
2011-02-11 03:12:39 -05:00
parent 7bdf592f7e
commit 2529ff6dae
148 changed files with 215 additions and 939 deletions
+1 -5
View File
@@ -48,6 +48,7 @@ class CommandCSAppendTopic : public Command
public:
CommandCSAppendTopic() : Command("APPENDTOPIC", 2, 2)
{
this->SetDesc("Add text to a channels topic");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -100,11 +101,6 @@ class CommandCSAppendTopic : public Command
{
me->SendMessage(source, _("Syntax: APPENDTOPIC channel text"));
}
void OnServHelp(CommandSource &source)
{
me->SendMessage(source, _(" APPENDTOPIC Add text to a channels topic"));
}
};
class CSAppendTopic : public Module
+1 -5
View File
@@ -123,6 +123,7 @@ class CommandCSEnforce : public Command
public:
CommandCSEnforce() : Command("ENFORCE", 1, 2)
{
this->SetDesc("Enforce various channel modes and set options");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -207,11 +208,6 @@ class CommandCSEnforce : public Command
{
me->SendMessage(source, _("Syntax: \002ENFORCE \037channel\037 [\037what\037]\002"));
}
void OnServHelp(CommandSource &source)
{
me->SendMessage(source, _(" ENFORCE Enforce various channel modes and set options"));
}
};
class CSEnforce : public Module
+1 -5
View File
@@ -99,6 +99,7 @@ class CommandEntryMessage : public Command
public:
CommandEntryMessage(const Anope::string &cname) : Command(cname, 2, 3)
{
this->SetDesc("Manage the channel's entry messages");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -150,11 +151,6 @@ class CommandEntryMessage : public Command
"Controls what messages will be sent to users when they join the channel."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(_(" ENTRYMSG Manage the channel's entrymsgs"));
}
};
class CSEntryMessage : public Module
+3 -7
View File
@@ -16,8 +16,9 @@ class CommandCSSetMisc : public Command
{
Anope::string Desc;
public:
CommandCSSetMisc(const Anope::string &cname, const Anope::string &desc, const Anope::string &cpermission = "") : Command(cname, 1, 2, cpermission), Desc(desc)
CommandCSSetMisc(const Anope::string &cname, const Anope::string &cdesc, const Anope::string &cpermission = "") : Command(cname, 1, 2, cpermission), Desc(cdesc)
{
this->SetDesc(cdesc);
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -43,17 +44,12 @@ class CommandCSSetMisc : public Command
{
SyntaxError(source, "SET", LanguageString::CHAN_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(" %-10s %s", this->name.c_str(), this->Desc.c_str());
}
};
class CommandCSSASetMisc : public CommandCSSetMisc
{
public:
CommandCSSASetMisc(const Anope::string &cname, const Anope::string &desc) : CommandCSSetMisc(cname, desc, "chanserv/saset/" + cname)
CommandCSSASetMisc(const Anope::string &cname, const Anope::string &cdesc) : CommandCSSetMisc(cname, cdesc, "chanserv/saset/" + cname)
{
}
+1 -5
View File
@@ -56,6 +56,7 @@ class CommandCSTBan : public Command
public:
CommandCSTBan() : Command("TBAN", 3, 3)
{
this->SetDesc("Bans the user for a given length of time");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -100,11 +101,6 @@ class CommandCSTBan : public Command
{
me->SendMessage(source, _("Syntax: TBAN channel nick time"));
}
void OnServHelp(CommandSource &source)
{
me->SendMessage(source, _(" TBAN Bans the user for a given length of time"));
}
};
class CSTBan : public Module
+1 -5
View File
@@ -123,6 +123,7 @@ class CommandSQLSync : public Command
public:
CommandSQLSync() : Command("SQLSYNC", 0, 0, "operserv/sqlsync")
{
this->SetDesc("Import your databases to SQL");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params);
@@ -136,11 +137,6 @@ class CommandSQLSync : public Command
"import your databases into SQL."));
return true;
}
void OnServHelp(CommandSource &source)
{
source.Reply(_(" SQLSYNC Import your databases to SQL"));
}
};
class MySQLInterface : public SQLInterface
+4 -12
View File
@@ -47,6 +47,7 @@ class CommandHSRequest : public Command
public:
CommandHSRequest() : Command("REQUEST", 1, 1)
{
this->SetDesc("Request a vHost for your nick");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -126,11 +127,6 @@ class CommandHSRequest : public Command
{
me->SendMessage(source, _("Syntax: \002REQUEST \037vhost\037\002"));
}
void OnServHelp(CommandSource &source)
{
me->SendMessage(source, _(" REQUEST Request a vHost for your nick"));
}
};
class CommandHSActivate : public Command
@@ -138,6 +134,7 @@ class CommandHSActivate : public Command
public:
CommandHSActivate() : Command("ACTIVATE", 1, 1, "hostserv/set")
{
this->SetDesc("Approve the requested vHost of a user");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -187,13 +184,6 @@ class CommandHSActivate : public Command
{
me->SendMessage(source, _("Syntax: \002ACTIVATE \037nick\037\002"));
}
void OnServHelp(CommandSource &source)
{
me->SendMessage(source, _(" ACTIVATE Approve the requested vHost of a user\n"
" REJECT Reject the requested vHost of a user\n"
" WAITING Convenience command for LIST +req"));
}
};
class CommandHSReject : public Command
@@ -201,6 +191,7 @@ class CommandHSReject : public Command
public:
CommandHSReject() : Command("REJECT", 1, 2, "hostserv/set")
{
this->SetDesc("Reject the requested vHost of a user");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -295,6 +286,7 @@ class CommandHSWaiting : public HSListBase
public:
CommandHSWaiting() : HSListBase("WAITING", 0, 0)
{
this->SetDesc("Convenience command for LIST +req");
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
+1 -1
View File
@@ -14,7 +14,7 @@ class XMLRPCUser : public User
this->server = Me;
}
void SendMessage(BotInfo *, const Anope::string &msg)
void SendMessage(BotInfo *, Anope::string msg)
{
this->out += msg + "\n";
}
+4 -8
View File
@@ -19,8 +19,9 @@ class CommandNSSetMisc : public Command
Anope::string Desc;
public:
CommandNSSetMisc(const Anope::string &cname, const Anope::string &desc, const Anope::string &cpermission = "") : Command(cname, 1, 2, cpermission), Desc(desc)
CommandNSSetMisc(const Anope::string &cname, const Anope::string &cdesc, const Anope::string &cpermission = "") : Command(cname, 1, 2, cpermission), Desc(cdesc)
{
this->SetDesc(cdesc);
}
CommandReturn Execute(CommandSource &source, const std::vector<Anope::string> &params)
@@ -47,17 +48,12 @@ class CommandNSSetMisc : public Command
{
SyntaxError(source, "SET", LanguageString::NICK_SET_SYNTAX);
}
void OnServHelp(CommandSource &source)
{
source.Reply(" %-10s %s", this->name.c_str(), this->Desc.c_str());
}
};
class CommandNSSASetMisc : public CommandNSSetMisc
{
public:
CommandNSSASetMisc(const Anope::string &cname, const Anope::string &desc) : CommandNSSetMisc(cname, desc, "nickserv/saset/" + cname)
CommandNSSASetMisc(const Anope::string &cname, const Anope::string &cdesc) : CommandNSSetMisc(cname, cdesc, "nickserv/saset/" + cname)
{
}
@@ -75,7 +71,7 @@ class NSSetMisc : public Module
Anope::string Desc;
bool ShowHidden;
CommandInfo(const Anope::string &name, const Anope::string &desc, bool showhidden) : Name(name), Desc(desc), ShowHidden(showhidden) { }
CommandInfo(const Anope::string &name, const Anope::string &cdesc, bool showhidden) : Name(name), Desc(cdesc), ShowHidden(showhidden) { }
};
std::map<Anope::string, CommandInfo *> Commands;