SVN Commit by dpage: r4230 - trunk/pgadmin3/xtra/pgagent

From: svn(at)pgadmin(dot)org
To: pgadmin-hackers(at)postgresql(dot)org
Subject: SVN Commit by dpage: r4230 - trunk/pgadmin3/xtra/pgagent
Date: 2005-05-23 08:29:14
Message-ID: 200505230829.j4N8TEEu024091@developer.pgadmin.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Author: dpage
Date: 2005-05-23 09:29:14 +0100 (Mon, 23 May 2005)
New Revision: 4230

Modified:
trunk/pgadmin3/xtra/pgagent/unix.cpp
trunk/pgadmin3/xtra/pgagent/win32.cpp
Log:
Display filename correctly in usage(), per Raphael Enrici

Modified: trunk/pgadmin3/xtra/pgagent/unix.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/unix.cpp 2005-05-20 21:49:23 UTC (rev 4229)
+++ trunk/pgadmin3/xtra/pgagent/unix.cpp 2005-05-23 08:29:14 UTC (rev 4230)
@@ -17,10 +17,12 @@
#error this file is for unix only!
#endif

-void usage()
+void usage(const wxString &executable)
{
+ wxFileName *fn = new wxFileName(executable);
+
wxPrintf(_("Usage:\n"));
- wxPrintf(_("pgAgent INSTALL [options] <connect-string>\n"));
+ wxPrintf(fn->GetName() + _(" [options] <connect-string>\n"));
wxPrintf(_("options:\n"));
wxPrintf(_("-t <poll time interval in seconds (default 10)>\n"));
wxPrintf(_("-r <retry period after connection abort in seconds (>=10, default 30)>\n"));
@@ -76,9 +78,12 @@
// Statup wx
wxInitialize();

+ wxString executable;
+ executable = wxString::FromAscii(argv[0]);
+
if (argc < 2)
{
- usage();
+ usage(executable);
return 1;
}

Modified: trunk/pgadmin3/xtra/pgagent/win32.cpp
===================================================================
--- trunk/pgadmin3/xtra/pgagent/win32.cpp 2005-05-20 21:49:23 UTC (rev 4229)
+++ trunk/pgadmin3/xtra/pgagent/win32.cpp 2005-05-23 08:29:14 UTC (rev 4230)
@@ -15,6 +15,7 @@
#error this file is for win32 only!
#endif

+#include <wx/filename.h>
#include <process.h>

// for debugging purposes, we can start the service paused
@@ -314,11 +315,13 @@



-void usage()
+void usage(const wxString &executable)
{
+ wxFileName *fn = new wxFileName(executable);
+
wxPrintf(_("Usage:\n"));
- wxPrintf(_("pgAgent REMOVE <serviceName>\n"));
- wxPrintf(_("pgAgent INSTALL <serviceName> [options] <connect-string>\n"));
+ wxPrintf(fn->GetName() + _(" REMOVE <serviceName>\n"));
+ wxPrintf(fn->GetName() + _(" INSTALL <serviceName> [options] <connect-string>\n"));
wxPrintf(_("options:\n"));
wxPrintf(_("-u <user>\n"));
wxPrintf(_("-p <password>\n"));
@@ -350,15 +353,15 @@
// Statup wx
wxInitialize();

+ wxString executable;
+ executable = wxString::FromAscii(*argv++);
+
if (argc < 3)
{
- usage();
+ usage(executable);
return;
}

- wxString executable;
- executable = wxString::FromAscii(*argv++);
-
wxString command;
command = wxString::FromAscii(*argv++);

@@ -441,7 +444,7 @@
}
else
{
- usage();
+ usage(executable);
}

return;

Browse pgadmin-hackers by date

  From Date Subject
Next Message svn 2005-05-23 08:31:10 SVN Commit by dpage: r4231 - trunk/pgadmin3/xtra/pgagent
Previous Message Dave Page 2005-05-22 15:49:14 Re: pgAgent usage string should be reviewed