summaryrefslogtreecommitdiff
path: root/plugins/NotifyAnything/SendLog/src/SendLog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/NotifyAnything/SendLog/src/SendLog.cpp')
-rw-r--r--plugins/NotifyAnything/SendLog/src/SendLog.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/plugins/NotifyAnything/SendLog/src/SendLog.cpp b/plugins/NotifyAnything/SendLog/src/SendLog.cpp
new file mode 100644
index 0000000000..de22515bfc
--- /dev/null
+++ b/plugins/NotifyAnything/SendLog/src/SendLog.cpp
@@ -0,0 +1,34 @@
+#include "Common.h"
+
+void implementation(int argc, char **argv, bool console);
+
+int main(int argc, char **argv)
+try
+{
+ if (argc == 2 && !strcmp("/?", argv[1])) {
+ std::cout << "\n"
+ "Syntax: sendlog [-T] [-H host] [-P port] [-p prefix]\n"
+ "\tSends each input line as a separate message, with optional prefix.\n"
+ "\n"
+ "Syntax: sendlog text\n"
+ "\tSends single text message.\n"
+ "\n"
+ << std::flush;
+ return 0;
+ }
+
+ implementation(argc, argv, true);
+}
+catch (DWORD err) {
+ LPVOID lpMsgBuf;
+ FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS,
+ NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL);
+
+ std::cerr << (LPCTSTR)lpMsgBuf << std::endl;
+ if (!std::cerr)
+ MessageBox(NULL, (LPCTSTR)lpMsgBuf, "sendlog", MB_OK);
+
+ LocalFree(lpMsgBuf);
+
+ return 1;
+}