commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r923337 - in /commons/proper/daemon/trunk/src: native/nt/procrun/apps/prunsrv/prunsrv.c site/xdoc/procrun.xml
Date Mon, 15 Mar 2010 16:59:50 GMT
Author: mturk
Date: Mon Mar 15 16:59:50 2010
New Revision: 923337

URL: http://svn.apache.org/viewvc?rev=923337&view=rev
Log:
DAEMON-142 Split help from version. Add new //VS option for displaying version string

Modified:
    commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c
    commons/proper/daemon/trunk/src/site/xdoc/procrun.xml

Modified: commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c?rev=923337&r1=923336&r2=923337&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c (original)
+++ commons/proper/daemon/trunk/src/native/nt/procrun/apps/prunsrv/prunsrv.c Mon Mar 15 16:59:50
2010
@@ -75,6 +75,7 @@ static LPCWSTR _commands[] = {
     L"IS",      /* 5 Install Service */
     L"DS",      /* 6 Delete Service */
     L"?",       /* 7 Help */
+    L"VS",      /* 8 Version */
     NULL
 };
 
@@ -307,11 +308,11 @@ static BOOL redirectStdStreams(APX_STDWR
 static void printUsage(LPAPXCMDLINE lpCmdline, BOOL isHelp)
 {
     int i = 0;
-    fwprintf(stderr, L"Usage: %s //CMD//Servce [--options]\n",
+    fwprintf(stderr, L"Usage: %s //CMD//Service [--options]\n",
              lpCmdline->szExecutable);
     fwprintf(stderr, L"  Commands:\n");
     if (isHelp)
-        fwprintf(stderr, L"  //?                  This page\n");        
+        fwprintf(stderr, L"  //?                  This page\n");
     fwprintf(stderr, L"  //IS[//ServiceName]  Install Service\n");
     fwprintf(stderr, L"  //US[//ServiceName]  Update Service parameters\n");
     fwprintf(stderr, L"  //DS[//ServiceName]  Delete Service\n");
@@ -323,7 +324,17 @@ static void printUsage(LPAPXCMDLINE lpCm
         fwprintf(stderr, L"  --%s\n", _options[i].szName);
         ++i;
     }
-    fwprintf(stderr, L"\nCommons Daemon Service Runner version %S\n", PRG_VERSION);    
+}
+
+static void printVersion(void)
+{
+#ifdef _WIN64
+    int b = 64;
+#else
+    int b = 32;
+#endif
+    fwprintf(stderr, L"Commons Daemon Service Runner version %S/Win%d (%S)\n",
+            PRG_VERSION, b, __DATE__);
     fwprintf(stderr, L"Copyright (c) 2000-2010 The Apache Software Foundation.\n");
 }
 
@@ -1430,8 +1441,11 @@ void __cdecl main(int argc, char **argv)
             if (!docmdDeleteService(lpCmdline))
                 rv = 8;
         break;
-        case 7: /* Help. Print version and exit */
-            printUsage(lpCmdline, TRUE);            
+        case 7: /* Print Usage and exit */
+            printUsage(lpCmdline, TRUE);
+        break;
+        case 8: /* Print version and exit */
+            printVersion();
         break;
         default:
             /* Unknown command option */

Modified: commons/proper/daemon/trunk/src/site/xdoc/procrun.xml
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/site/xdoc/procrun.xml?rev=923337&r1=923336&r2=923337&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/site/xdoc/procrun.xml (original)
+++ commons/proper/daemon/trunk/src/site/xdoc/procrun.xml Mon Mar 15 16:59:50 2010
@@ -57,36 +57,48 @@
 </section>
 <section name="Command line arguments">
 <p>
-    Each command line directive is in the form of <b>//XX//ServiceName</b>
+    Each command line directive is in the form of <b>//XX[//ServiceName]</b>
 </p>
     <p>The available command line options are:</p>
 <p> 
     <table>
-    <tr><th>//TS//</th>
+    <tr><th>//TS</th>
         <td>Run the service as console application</td>
         <td>This is the default operation. It is called if the no option is
             provided but the executable is renamed to <b>servicename.exe</b></td>
     </tr>
-    <tr><th>//RS//</th>
+    <tr><th>//RS</th>
         <td>Run the service</td>
         <td>Called only from ServiceManager</td>
     </tr>
-    <tr><th>//SS//</th>
+    <tr><th>//SS</th>
         <td>Stop the service</td>
         <td></td>
     </tr>
-    <tr><th>//US//</th>
+    <tr><th>//US</th>
         <td>Update service parameters</td>
         <td></td>
     </tr>
-    <tr><th>//IS//</th>
+    <tr><th>//IS</th>
         <td>Install service</td>
         <td></td>
     </tr>
-    <tr><th>//DS//</th>
+    <tr><th>//DS</th>
         <td>Delete service</td>
         <td>Stops the service if running</td>
     </tr>        
+    <tr><th>//DS</th>
+        <td>Delete service</td>
+        <td>Stops the service if running</td>
+    </tr>        
+    <tr><th>//VS</th>
+        <td>Version</td>
+        <td>Print version and exit</td>
+    </tr>        
+    <tr><th>//?</th>
+        <td>Help</td>
+        <td>Print usage and exit</td>
+    </tr>        
     </table>
 </p> 
 </section>



Mime
View raw message