From 0f7651d9284fb651677780b836e661deaeab458e Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Sun, 31 Aug 2008 18:01:41 +0000 Subject: [PATCH] Helps if I commit the new source file... git-svn-id: file:///srv/svn/ircclient/trunk@4 a9804ffe-773b-11dd-bd7c-89c3ef1d2733 --- mirc/src/main.cpp | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 mirc/src/main.cpp diff --git a/mirc/src/main.cpp b/mirc/src/main.cpp new file mode 100644 index 0000000..b7a4630 --- /dev/null +++ b/mirc/src/main.cpp @@ -0,0 +1,40 @@ +#include +#include "script.h" + +int main(int argc, char* argv[]) { + QTextStream output(stdout); + + output << "Creating manager\n"; + MIRCScriptManager *mirc = new MIRCScriptManager; + output << "Creating script object\n"; + MIRCScript *ms = new MIRCScript(mirc); + if (argc < 2) { + output << "No mIRC script file was specified!\n"; + return(1); + } + output << "Attempting to load " << argv[1] << "\n"; + if (ms->load(argv[1])) { + output << "MRC LOADED\n"; + output << "Code:\n" << ms->code(); + output << "Aliases:\n"; + QMapIterator alias(ms->aliases()); + while(alias.hasNext()) { + alias.next(); + output << (alias.value().global ? "global" : "local"); + output << " " << alias.key() << "\n"; + } + if (ms->run()) { + output << "MRC RAN SUCCESSFULLY\n"; + QMapIterator i(mirc->variables()); + output << "Variables:\n"; + while(i.hasNext()) { + i.next(); + output << i.key() << " = " << i.value() << "\n"; + } + } + } else { + output << "Failed to load " << argv[1] << "\n"; + return(1); + } + return 0; +}