Commit d4a5d861 authored by Conrad Parker's avatar Conrad Parker

ensure configured version number is used when reporting version of installed

commands. Closes ticket:832

svn path=/trunk/vorbis-tools/; revision=12221
parent 9951b529
......@@ -198,7 +198,7 @@ int parse_cmdline_options (int argc, char **argv,
break;
case 'V':
status_error(_("ogg123 from %s %s\n"), PACKAGE, VERSION);
status_error(_("ogg123 from %s %s"), PACKAGE, VERSION);
exit(0);
break;
......
......@@ -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 @@ struct option long_options[] = {
{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 @@ static int sign = 1;
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 @@ static void parse_options(int argc, char **argv)
exit(0);
break;
case 'v':
fprintf(stderr, VERSIONSTRING);
version();
exit(0);
break;
case 's':
......@@ -351,7 +358,6 @@ int main(int argc, char **argv)
int i;
if(argc == 1) {
fprintf(stderr, VERSIONSTRING);
usage();
return 1;
}
......@@ -359,7 +365,7 @@ int main(int argc, char **argv)
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");
......
......@@ -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@xiph.org>\n"
#define CHUNK 4096 /* We do reads, etc. in multiples of this */
......
......@@ -951,9 +951,14 @@ static void process_file(char *filename) {
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@xiph.org>\n"
version ();
printf (_(" by the Xiph.Org Foundation (http://www.xiph.org/)\n\n"));
printf(_("(c) 2003-2005 Michael Smith <msmith@xiph.org>\n"
"\n"
"Usage: ogginfo [flags] file1.ogg [file2.ogg ... fileN.ogg]\n"
"Flags supported:\n"
......@@ -961,7 +966,9 @@ static void usage(void) {
"\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 @@ int main(int argc, char **argv) {
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;
......
......@@ -426,7 +426,7 @@ void parse_options(int argc, char *argv[], param_t *param)
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':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment