[xiph-commits] r12221 - in trunk/vorbis-tools: ogg123 oggdec oggenc ogginfo vorbiscomment

conrad at svn.xiph.org conrad at svn.xiph.org
Sat Dec 16 23:32:52 PST 2006


Author: conrad
Date: 2006-12-16 23:32:45 -0800 (Sat, 16 Dec 2006)
New Revision: 12221

Modified:
   trunk/vorbis-tools/ogg123/cmdline_options.c
   trunk/vorbis-tools/oggdec/oggdec.c
   trunk/vorbis-tools/oggenc/oggenc.c
   trunk/vorbis-tools/ogginfo/ogginfo2.c
   trunk/vorbis-tools/vorbiscomment/vcomment.c
Log:
ensure configured version number is used when reporting version of installed
commands. Closes ticket:832


Modified: trunk/vorbis-tools/ogg123/cmdline_options.c
===================================================================
--- trunk/vorbis-tools/ogg123/cmdline_options.c	2006-12-17 06:56:20 UTC (rev 12220)
+++ trunk/vorbis-tools/ogg123/cmdline_options.c	2006-12-17 07:32:45 UTC (rev 12221)
@@ -198,7 +198,7 @@
 	break;
 	
       case 'V':
-	status_error(_("ogg123 from %s %s\n"), PACKAGE, VERSION);
+	status_error(_("ogg123 from %s %s"), PACKAGE, VERSION);
 	exit(0);
 	break;
 

Modified: trunk/vorbis-tools/oggdec/oggdec.c
===================================================================
--- trunk/vorbis-tools/oggdec/oggdec.c	2006-12-17 06:56:20 UTC (rev 12220)
+++ trunk/vorbis-tools/oggdec/oggdec.c	2006-12-17 07:32:45 UTC (rev 12221)
@@ -24,6 +24,8 @@
 
 #include <vorbis/vorbisfile.h>
 
+#include "i18n.h"
+
 struct option long_options[] = {
     {"quiet", 0,0,'Q'},
     {"help",0,0,'h'},
@@ -36,8 +38,6 @@
     {NULL,0,0,0}
 };
 
-#define VERSIONSTRING "OggDec 1.1.1\n"
-
 static int quiet = 0;
 static int bits = 16;
 static int endian = 0;
@@ -46,7 +46,14 @@
 unsigned char headbuf[44]; /* The whole buffer */
 char *outfilename = NULL;
 
-static void usage(void) {
+static void version (void) {
+    fprintf (stderr, _("oggdec from %s %s\n"), PACKAGE, VERSION);
+}
+
+static void usage(void)
+{
+    version ();
+    fprintf (stderr, _(" by the Xiph.Org Foundation (http://www.xiph.org/)\n\n"));
     fprintf(stderr, "Usage: oggdec [flags] file1.ogg [file2.ogg ... fileN.ogg]\n"
                     "\n"
                     "Supported flags:\n"
@@ -86,7 +93,7 @@
                 exit(0);
                 break;
             case 'v':
-                fprintf(stderr, VERSIONSTRING);
+                version();
                 exit(0);
                 break;
             case 's':
@@ -351,7 +358,6 @@
     int i;
 
     if(argc == 1) {
-        fprintf(stderr, VERSIONSTRING);
         usage();
         return 1;
     }
@@ -359,7 +365,7 @@
     parse_options(argc,argv);
 
     if(!quiet)
-        fprintf(stderr, VERSIONSTRING);
+        version();
 
     if(optind >= argc) {
         fprintf(stderr, "ERROR: No input files specified. Use -h for help\n");

Modified: trunk/vorbis-tools/oggenc/oggenc.c
===================================================================
--- trunk/vorbis-tools/oggenc/oggenc.c	2006-12-17 06:56:20 UTC (rev 12220)
+++ trunk/vorbis-tools/oggenc/oggenc.c	2006-12-17 07:32:45 UTC (rev 12221)
@@ -29,7 +29,7 @@
 #include "i18n.h"
 
 
-#define VERSION_STRING "OggEnc v" VERSION " \n"
+#define VERSION_STRING "oggenc from vorbis-tools " VERSION " \n"
 #define COPYRIGHT "(c) 2000-2005 Michael Smith <msmith at xiph.org>\n"
 
 #define CHUNK 4096 /* We do reads, etc. in multiples of this */

Modified: trunk/vorbis-tools/ogginfo/ogginfo2.c
===================================================================
--- trunk/vorbis-tools/ogginfo/ogginfo2.c	2006-12-17 06:56:20 UTC (rev 12220)
+++ trunk/vorbis-tools/ogginfo/ogginfo2.c	2006-12-17 07:32:45 UTC (rev 12221)
@@ -951,9 +951,14 @@
     fclose(file);
 }
 
+static void version (void) {
+    printf (_("ogginfo from %s %s\n"), PACKAGE, VERSION);
+}
+
 static void usage(void) {
-    printf(_("ogginfo 1.1.0\n"
-             "(c) 2003-2005 Michael Smith <msmith at xiph.org>\n"
+    version ();
+    printf (_(" by the Xiph.Org Foundation (http://www.xiph.org/)\n\n"));
+    printf(_("(c) 2003-2005 Michael Smith <msmith at xiph.org>\n"
              "\n"
              "Usage: ogginfo [flags] file1.ogg [file2.ogg ... fileN.ogg]\n"
              "Flags supported:\n"
@@ -961,7 +966,9 @@
              "\t-q Make less verbose. Once will remove detailed informative\n"
              "\t   messages, two will remove warnings\n"
              "\t-v Make more verbose. This may enable more detailed checks\n"
-             "\t   for some stream types.\n\n"));
+             "\t   for some stream types.\n"));
+    printf (_("\t-V Output version information and exit\n"));
+    /*printf (_("  -V, --version           Output version information and exit\n"));*/
 }
 
 int main(int argc, char **argv) {
@@ -981,11 +988,14 @@
         exit(1);
     }
 
-    while((ret = getopt(argc, argv, "hvq")) >= 0) {
+    while((ret = getopt(argc, argv, "hqvV")) >= 0) {
         switch(ret) {
             case 'h':
                 usage();
                 return 0;
+            case 'V':
+                version();
+                return 0;
             case 'v':
                 verbose++;
                 break;

Modified: trunk/vorbis-tools/vorbiscomment/vcomment.c
===================================================================
--- trunk/vorbis-tools/vorbiscomment/vcomment.c	2006-12-17 06:56:20 UTC (rev 12220)
+++ trunk/vorbis-tools/vorbiscomment/vcomment.c	2006-12-17 07:32:45 UTC (rev 12221)
@@ -426,7 +426,7 @@
 				param->mode = MODE_APPEND;
 				break;
 			case 'V':
-				fprintf(stderr, "Vorbiscomment " VERSION "\n");
+				fprintf(stderr, "vorbiscomment from vorbis-tools " VERSION "\n");
 				exit(0);
 				break;
 			case 'h':



More information about the commits mailing list