OSSP CVS Repository

ossp - Check-in [1754]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 1754
Date: 2002-Jan-31 16:53:43 (local)
2002-Jan-31 15:53:43 (UTC)
User:thl
Branch:
Comment: moved --version option
Tickets:
Inspections:
Files:
ossp-pkg/lmtp2nntp/example.conf      1.13 -> 1.14     1 inserted, 1 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_config.c      1.33 -> 1.34     15 inserted, 0 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_main.c      1.26 -> 1.27     0 inserted, 4 deleted
ossp-pkg/lmtp2nntp/lmtp2nntp_option.c      1.7 -> 1.8     1 inserted, 0 deleted

ossp-pkg/lmtp2nntp/example.conf 1.13 -> 1.14

--- example.conf 2002/01/31 15:42:31     1.13
+++ example.conf 2002/01/31 15:53:43     1.14
@@ -50,6 +50,6 @@
 timeoutnntpread    60                           #see        --timeoutnntpread
 timeoutnntpwrite   60                           #see        --timeoutnntpwrite
 user            gate                            #see -u aka --user
-                                                #    -v aka --version is not available in the configfile
+version                                         #see -v aka --version
 newsgroup       "test"
 newsgroup       "alt.test"                      #see man page for information about newsgroup


ossp-pkg/lmtp2nntp/lmtp2nntp_config.c 1.33 -> 1.34

--- lmtp2nntp_config.c   2002/01/31 15:42:31     1.33
+++ lmtp2nntp_config.c   2002/01/31 15:53:43     1.34
@@ -774,6 +774,21 @@
     }
     catch (ex)
         rethrow;
+
+    /* --version FLAG */
+    try {
+        if (   (val_get(ctx->val, "option.version", &ov) != VAL_OK)
+            || (ov->ndata != 1)
+            || (ov->data.f != 1)
+              ) throw(0,0,0);
+        log1(ctx, TRACE, "--version = %d", ov->data.f);
+
+        log1(ctx, INFO, "program version %s", lmtp2nntp_version.v_gnu);
+        fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu); //FIXME is fprintf really the way to go?
+
+    }
+    catch (ex)
+        rethrow;
 CUS:
     return;
 }


ossp-pkg/lmtp2nntp/lmtp2nntp_main.c 1.26 -> 1.27

--- lmtp2nntp_main.c     2002/01/31 15:42:31     1.26
+++ lmtp2nntp_main.c     2002/01/31 15:53:43     1.27
@@ -442,10 +442,6 @@
     /* read in the arguments */
     while ((i = getopt(argc, argv, "C:DKP:Va:b:c:d:g:h:l:m:n:o:r:s:t:u:v")) != -1) {
         switch (i) {
-            case 'v': /*POD [B<-v>] (version)*/
-                fprintf(stdout, "%s\n", lmtp2nntp_version.v_gnu);
-                CU(0);
-                break;
             case '?':
             default:
                 usage(ctx->progname);


ossp-pkg/lmtp2nntp/lmtp2nntp_option.c 1.7 -> 1.8

--- lmtp2nntp_option.c   2002/01/31 15:42:31     1.7
+++ lmtp2nntp_option.c   2002/01/31 15:53:43     1.8
@@ -627,6 +627,7 @@
     (void)option_register(o, "operationmode",      'o', OPT_SINGLE, &stdsyntax, "m/.*/",     "foo22", "post|feed" );
     (void)option_register(o, "l2spec",             'l', OPT_SINGLE, &stdsyntax, "m/.*/",     "L2 channel tree textual specification", "l2spec" );
     (void)option_register(o, "user",               'u', OPT_SINGLE, &stdsyntax, "m/.*/",     "foo24", "uid|name" );
+    (void)option_register(o, "version",            'v', OPT_FLAG,   &stdsyntax, NULL,        "fo24a", NULL );
     (void)option_register(o, "restrictheader",     'r', OPT_SINGLE, &stdsyntax, "m/.*/",     "foo25", "regex" );
     (void)option_register(o, "newsgroup",          NUL, OPT_MULTI,  &stdsyntax, "m/.*/",     "foo26", "newsgroup");
 

CVSTrac 2.0.1