bool Go(void);
void ShowOptions(void);
+void ShowVersion(void);
wxChar wxTex2RTFBuffer[1500];
}
}
+ TexPathList.Add(::wxGetCwd());
+
#ifdef NO_GUI
if (InputFile.empty() || OutputFile.empty())
{
i ++;
checkSyntax = true;
}
+ else if (wxStrcmp(argv[i], _T("-version")) == 0)
+ {
+ i ++;
+ ShowVersion();
+ }
else
{
wxString buf;
if (!path.empty())
ReadCustomMacros(path);
- Go();
- if (runTwice)
+ bool rc = Go();
+ if ( rc && runTwice )
{
- Go();
+ rc = Go();
}
#ifdef NO_GUI
- return true;
+ return rc;
#else
OnExit(); // Do cleanup since OnExit won't be called now
return false;
return 0;
}
#endif
-void ShowOptions(void)
+
+void ShowVersion(void)
{
wxChar buf[100];
wxSnprintf(buf, sizeof(buf), _T("Tex2RTF version %.2f"), versionNo);
OnInform(buf);
+}
+
+void ShowOptions(void)
+{
+ ShowVersion();
OnInform(_T("Usage: tex2rtf [input] [output] [switches]\n"));
OnInform(_T("where valid switches are"));
#ifndef NO_GUI
frame->SetTitle(buf);
}
- wxStartTimer();
+ wxLongLong localTime = wxGetLocalTimeMillis();
#endif
// Find extension-less filename
wxString buf;
#ifndef NO_GUI
- long tim = wxGetElapsedTime();
- buf.Printf(_T("Finished PASS #%d in %ld seconds.\n"), passNumber, (long)(tim/1000.0));
+ wxLongLong elapsed = wxGetLocalTimeMillis() - localTime;
+ buf.Printf(_T("Finished PASS #%d in %ld seconds.\n"), passNumber, (long)(elapsed.GetLo()/1000.0));
OnInform((wxChar *)buf.c_str());
if (errorCount)