summaryrefslogtreecommitdiff
path: root/include/commands.h
diff options
context:
space:
mode:
authorAdam <Adam@drink-coca-cola.info>2010-06-03 23:09:22 -0400
committerAdam <Adam@anope.org>2010-06-18 21:04:09 -0400
commite6447fa2c40270d2e2435229127dd970194b47d9 (patch)
tree65778fc16c1789517595b2b4cbfcb2c9330b022e /include/commands.h
parent6cd88494662c5c4af2da891926dcc82367596cb9 (diff)
Added in a subcommand system and switched ns_set and ns_saset to use it
Diffstat (limited to 'include/commands.h')
-rw-r--r--include/commands.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/include/commands.h b/include/commands.h
index 9e597204e..327d65736 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -23,7 +23,7 @@ class Command;
typedef std::map<ci::string, Command *> CommandMap;
/** The return value from commands.
- * */
+ */
enum CommandReturn
{
MOD_CONT,
@@ -32,7 +32,8 @@ enum CommandReturn
extern CoreExport Command *FindCommand(BotInfo *bi, const ci::string &cmd);
extern CoreExport void mod_help_cmd(BotInfo *bi, User *u, const ci::string &cmd);
-extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const ci::string &cmd);
+extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, const std::string &message);
+extern CoreExport void mod_run_cmd(BotInfo *bi, User *u, Command *c, const ci::string &command, const ci::string &message);
enum CommandFlag
{
@@ -101,6 +102,16 @@ class CoreExport Command : public Flags<CommandFlag>
* @param reststr The permission required to successfully execute this command
*/
void SetPermission(const std::string &reststr);
+
+ /** Add a subcommand to this command
+ * @param c The command
+ */
+ virtual bool AddSubcommand(Command *c);
+
+ /** Delete a subcommand from this command
+ * @param cname The subcommand name
+ */
+ virtual bool DelSubcommand(const ci::string &cname);
};
#endif