Support lambdas in module commands
This commit is contained in:
1 parent
6509e26b89
commit
c1dc3e83d2
3 files changed
+24
-14
No files matched your search
+3
-4
@@ -71,16 +71,15 @@ class CNotesMod : public CModule {
|
||||
|
||||
public:
|
||||
MODCONSTRUCTOR(CNotesMod) {
|
||||
using std::placeholders::_1;
|
||||
AddHelpCommand();
|
||||
AddCommand("List", static_cast<CModCommand::ModCmdFunc>(&CNotesMod::ListCommand));
|
||||
AddCommand("Add", static_cast<CModCommand::ModCmdFunc>(&CNotesMod::AddNoteCommand),
|
||||
"<key> <note>");
|
||||
AddCommand("Del", static_cast<CModCommand::ModCmdFunc>(&CNotesMod::DelCommand),
|
||||
"<key>", "Delete a note");
|
||||
AddCommand("Mod", static_cast<CModCommand::ModCmdFunc>(&CNotesMod::ModCommand),
|
||||
"<key> <note>", "Modify a note");
|
||||
AddCommand("Get", static_cast<CModCommand::ModCmdFunc>(&CNotesMod::GetCommand),
|
||||
"<key>");
|
||||
AddCommand("Mod", "<key> <note>", "Modify a note", std::bind(&CNotesMod::ModCommand, this, _1));
|
||||
AddCommand("Get", "<key>", "", [this](const CString& sLine){ GetCommand(sLine); });
|
||||
}
|
||||
|
||||
virtual ~CNotesMod() {}
|
||||
|
||||
Reference in new issue
Block a user