From fca5eebe53f4ed08e1a0974511e7e922c0c5ebc2 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Tue, 17 Jul 2012 09:14:02 +0700 Subject: [PATCH] Fix presense and help of module arguments. See github issue #192 --- modules/autoattach.cpp | 2 ++ modules/autocycle.cpp | 2 ++ modules/autovoice.cpp | 6 ++++++ modules/awaystore.cpp | 6 ++++++ modules/block_motd.cpp | 4 ++++ modules/bouncedcc.cpp | 4 +++- modules/clearbufferonmsg.cpp | 4 ++++ modules/ctcpflood.cpp | 6 ++++++ modules/cyrusauth.cpp | 4 +++- modules/dcc.cpp | 4 ++++ modules/flooddetach.cpp | 6 ++++++ modules/imapauth.cpp | 6 ++++++ modules/listsockets.cpp | 4 ++++ modules/notes.cpp | 2 ++ modules/sample.cpp | 2 +- modules/sasl.cpp | 4 ++++ modules/savebuff.cpp | 2 ++ modules/schat.cpp | 2 ++ modules/send_raw.cpp | 4 ++++ modules/shell.cpp | 4 ++++ modules/stickychan.cpp | 2 ++ 21 files changed, 77 insertions(+), 3 deletions(-) diff --git a/modules/autoattach.cpp b/modules/autoattach.cpp index 97b81ab8c5..12ed1f68d9 100644 --- a/modules/autoattach.cpp +++ b/modules/autoattach.cpp @@ -248,6 +248,8 @@ class CChanAttach : public CModule { template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("autoattach"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("List of channel masks and channel masks with ! before them."); } USERMODULEDEFS(CChanAttach, "Reattaches you to channels on activity.") diff --git a/modules/autocycle.cpp b/modules/autocycle.cpp index 7eb6980bd4..815040ff4b 100644 --- a/modules/autocycle.cpp +++ b/modules/autocycle.cpp @@ -237,6 +237,8 @@ class CAutoCycleMod : public CModule { template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("autocycle"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("List of channel masks and channel masks with ! before them."); } USERMODULEDEFS(CAutoCycleMod, "Rejoins channels to gain Op if you're the only user left") diff --git a/modules/autovoice.cpp b/modules/autovoice.cpp index b25646540c..647beda480 100644 --- a/modules/autovoice.cpp +++ b/modules/autovoice.cpp @@ -275,4 +275,10 @@ class CAutoVoiceMod : public CModule { map m_msUsers; }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("autovoice"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("Each argument is either a channel you want autovoice for (which can include wildcards) or, if it starts with !, it is an exception for autovoice."); +} + NETWORKMODULEDEFS(CAutoVoiceMod, "Auto voice the good guys") diff --git a/modules/awaystore.cpp b/modules/awaystore.cpp index 4b0a99c879..d31a4720cd 100644 --- a/modules/awaystore.cpp +++ b/modules/awaystore.cpp @@ -480,5 +480,11 @@ void CAwayJob::RunJob() } } +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("awaystore"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("[ -notimer | -timer N ] [ passw0rd ]. N is number of seconds, 600 by default."); +} + NETWORKMODULEDEFS(CAway, "Adds auto-away with logging, useful when you use ZNC from different locations"); diff --git a/modules/block_motd.cpp b/modules/block_motd.cpp index 3ebbd58264..aed6b5e382 100644 --- a/modules/block_motd.cpp +++ b/modules/block_motd.cpp @@ -30,4 +30,8 @@ class CBlockMotd : public CModule { } }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("block_motd"); +} + USERMODULEDEFS(CBlockMotd, "Block the MOTD from IRC so it's not sent to your client(s).") diff --git a/modules/bouncedcc.cpp b/modules/bouncedcc.cpp index de8372c7f0..4b461df002 100644 --- a/modules/bouncedcc.cpp +++ b/modules/bouncedcc.cpp @@ -449,7 +449,9 @@ unsigned short CDCCBounce::DCCRequest(const CString& sNick, unsigned long uLongI return uListenPort; } - +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("bouncedcc"); +} USERMODULEDEFS(CBounceDCCMod, "Bounces DCC transfers through ZNC instead of sending them directly to the user. ") diff --git a/modules/clearbufferonmsg.cpp b/modules/clearbufferonmsg.cpp index c840dc133f..99ad5e8b1f 100644 --- a/modules/clearbufferonmsg.cpp +++ b/modules/clearbufferonmsg.cpp @@ -63,4 +63,8 @@ class CClearBufferOnMsgMod : public CModule { } }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("clearbufferonmsg"); +} + USERMODULEDEFS(CClearBufferOnMsgMod, "Clear all channel buffers whenever the user does something") diff --git a/modules/ctcpflood.cpp b/modules/ctcpflood.cpp index 1050a46919..ae7d2c76d3 100644 --- a/modules/ctcpflood.cpp +++ b/modules/ctcpflood.cpp @@ -113,4 +113,10 @@ class CCtcpFloodMod : public CModule { unsigned int m_iThresholdMsgs; }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("ctcpflood"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("This user module takes none to two arguments. The first argument is the number of lines after which the flood-protection is triggered. The second argument is the time (s) to in which the number of lines is reached. The default setting is 4 CTCPs in 2 seconds"); +} + USERMODULEDEFS(CCtcpFloodMod, "Don't forward CTCP floods to clients") diff --git a/modules/cyrusauth.cpp b/modules/cyrusauth.cpp index 0cea19d010..1ae9c41f84 100644 --- a/modules/cyrusauth.cpp +++ b/modules/cyrusauth.cpp @@ -210,7 +210,9 @@ class CSASLAuthMod : public CModule { }; template<> void TModInfo(CModInfo& Info) { - Info.SetWikiPage("saslauth"); + Info.SetWikiPage("cyrusauth"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("This global module takes up to two arguments - the methods of authentication - auxprop and saslauthd"); } GLOBALMODULEDEFS(CSASLAuthMod, "Allow users to authenticate via SASL password verification method") diff --git a/modules/dcc.cpp b/modules/dcc.cpp index b34cc7ce6e..2dbc6a4a47 100644 --- a/modules/dcc.cpp +++ b/modules/dcc.cpp @@ -471,5 +471,9 @@ bool CDCCSock::Seek(unsigned int uPos) { return false; } +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("dcc"); +} + USERMODULEDEFS(CDCCMod, "This module allows you to transfer files to and from ZNC") diff --git a/modules/flooddetach.cpp b/modules/flooddetach.cpp index d82821cd37..63015b8b0e 100644 --- a/modules/flooddetach.cpp +++ b/modules/flooddetach.cpp @@ -187,4 +187,10 @@ class CFloodDetachMod : public CModule { unsigned int m_iThresholdMsgs; }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("flooddetach"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("This user module takes up to two arguments. Arguments are msgs and secs numbers."); +} + USERMODULEDEFS(CFloodDetachMod, "Detach channels when flooded") diff --git a/modules/imapauth.cpp b/modules/imapauth.cpp index 944e505a89..571730c2e9 100644 --- a/modules/imapauth.cpp +++ b/modules/imapauth.cpp @@ -151,4 +151,10 @@ void CIMAPSock::ReadLine(const CString& sLine) { } } +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("imapauth"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("[ server [+]port [ UserFormatString ] ]"); +} + GLOBALMODULEDEFS(CIMAPAuthMod, "Allow users to authenticate via imap") diff --git a/modules/listsockets.cpp b/modules/listsockets.cpp index bb055ee05a..f00bd3b49c 100644 --- a/modules/listsockets.cpp +++ b/modules/listsockets.cpp @@ -243,5 +243,9 @@ class CListSockets : public CModule { }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("listsockets"); +} + USERMODULEDEFS(CListSockets, "List active sockets") diff --git a/modules/notes.cpp b/modules/notes.cpp index 2d4dcf3bea..098beb50f4 100644 --- a/modules/notes.cpp +++ b/modules/notes.cpp @@ -214,6 +214,8 @@ class CNotesMod : public CModule { template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("notes"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("This user module takes up to one arguments. It can be -disableNotesOnLogin not to show notes upon client login"); } USERMODULEDEFS(CNotesMod, "Keep and replay notes") diff --git a/modules/sample.cpp b/modules/sample.cpp index 846e008198..0c9df2b77a 100644 --- a/modules/sample.cpp +++ b/modules/sample.cpp @@ -244,7 +244,7 @@ class CSampleMod : public CModule { template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("sample"); Info.SetHasArgs(true); - Info.SetArgsHelpText("Please describe the arguments used by your module in one or two sentences."); + Info.SetArgsHelpText("Description of module arguments goes here."); } USERMODULEDEFS(CSampleMod, "To be used as a sample for writing modules") diff --git a/modules/sasl.cpp b/modules/sasl.cpp index 371c07dd21..048f8a5b77 100644 --- a/modules/sasl.cpp +++ b/modules/sasl.cpp @@ -425,4 +425,8 @@ class CSASLMod : public CModule { bool m_bAuthenticated; }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("sasl"); +} + NETWORKMODULEDEFS(CSASLMod, "Adds support for sasl authentication capability to authenticate to an IRC server") diff --git a/modules/savebuff.cpp b/modules/savebuff.cpp index 8ffa404dcb..3524259c67 100644 --- a/modules/savebuff.cpp +++ b/modules/savebuff.cpp @@ -360,6 +360,8 @@ void CSaveBuffJob::RunJob() template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("savebuff"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("This user module takes up to one arguments. Either --ask-pass or the password itself (which may contain spaces) or nothing"); } NETWORKMODULEDEFS(CSaveBuff, "Stores channel buffers to disk, encrypted") diff --git a/modules/schat.cpp b/modules/schat.cpp index d23dc631dd..545dbcace7 100644 --- a/modules/schat.cpp +++ b/modules/schat.cpp @@ -467,6 +467,8 @@ void CRemMarkerJob::RunJob() template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("schat"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("Path to .pem file, if differs from main ZNC's one"); } NETWORKMODULEDEFS(CSChat, "Secure cross platform (:P) chat system") diff --git a/modules/send_raw.cpp b/modules/send_raw.cpp index 4d5b24885f..65914f0b99 100644 --- a/modules/send_raw.cpp +++ b/modules/send_raw.cpp @@ -126,4 +126,8 @@ class CSendRaw_Mod: public CModule { } }; +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("send_raw"); +} + USERMODULEDEFS(CSendRaw_Mod, "Lets you send some raw IRC lines as/to someone else") diff --git a/modules/shell.cpp b/modules/shell.cpp index c60774910c..0056b81982 100644 --- a/modules/shell.cpp +++ b/modules/shell.cpp @@ -127,6 +127,10 @@ void CShellSock::Disconnected() { m_pParent->SetClient(NULL); } +template<> void TModInfo(CModInfo& Info) { + Info.SetWikiPage("shell"); +} + #ifdef MOD_SHELL_ALLOW_EVERYONE USERMODULEDEFS(CShellMod, "Gives shell access") #else diff --git a/modules/stickychan.cpp b/modules/stickychan.cpp index 150bfd0908..415c270912 100644 --- a/modules/stickychan.cpp +++ b/modules/stickychan.cpp @@ -189,6 +189,8 @@ bool CStickyChan::OnLoad(const CString& sArgs, CString& sMessage) template<> void TModInfo(CModInfo& Info) { Info.SetWikiPage("stickychan"); + Info.SetHasArgs(true); + Info.SetArgsHelpText("List of channels, separated by comma."); } NETWORKMODULEDEFS(CStickyChan, "configless sticky chans, keeps you there very stickily even")