#include <wx/string.h>
#include <wx/log.h>
#include <wx/dynarray.h>
+ #include <wx/wx.h>
#endif // WX_PRECOMP
#include <wx/file.h>
public:
HelpGenApp() {};
+#if wxUSE_GUI
bool OnInit();
+#else
+ int OnRun();
+#endif
};
IMPLEMENT_APP(HelpGenApp);
static void usage()
{
wxString prog = g_argv[0];
- wxString basename = prog.BeforeLast('/');
+ wxString basename = prog.AfterLast('/');
#ifdef __WXMSW__
if ( !basename )
- basename = prog.BeforeLast('\\');
+ basename = prog.AfterLast('\\');
#endif
if ( !basename )
basename = prog;
" mode specific options are:\n"
" -p do check parameter names (not done by default)\n"
"\n", basename.c_str(), basename.c_str());
-
+#ifndef wxUSE_GUI
exit(1);
+#endif
}
/*
{
*/
+#if wxUSE_GUI
bool HelpGenApp::OnInit()
+#else
+int HelpGenApp::OnRun()
+#endif
{
enum
{
// the file name is built from the class name by removing the leading "wx"
// if any and converting it to the lower case
- wxString filename = m_directoryOut;
+ wxString filename;
if ( name(0, 2) == "wx" ) {
filename << name.c_str() + 2;
}
filename.MakeLower();
filename += ".tex";
+ filename.Prepend(m_directoryOut);
if ( !m_overwrite && wxFile::Exists(filename) ) {
wxLogError("Won't overwrite existing file '%s' - please use '-f'.",
/*
$Log$
+ Revision 1.12 2000/10/09 13:53:33 juliansmart
+ Doc corrections; added HelpGen project files
+
+ Revision 1.11 2000/07/15 19:50:42 cvsuser
+ merged 2.2 branch
+
+ Revision 1.10.2.2 2000/03/27 15:33:10 VZ
+ don't trasnform output dir name to lower case
+
+ Revision 1.10 2000/03/11 10:05:23 VS
+ now compiles with wxBase
+
+ Revision 1.9 2000/01/16 13:25:21 VS
+ compilation fixes (gcc)
+
Revision 1.8 1999/09/13 14:29:39 JS
+
Made HelpGen into a wxWin app (still uses command-line args); moved includes
into src for simplicity; added VC++ 5 project file