Commit ea2ef4c9 authored by ivo's avatar ivo

Patches by Benno Schulenberg:

* internationalize the version string of oggenc
* correctness: make oggdec output help text on stdout instead of stderr

svn path=/trunk/vorbis-tools/; revision=15069
parent 6e565563
......@@ -47,30 +47,29 @@ unsigned char headbuf[44]; /* The whole buffer */
char *outfilename = NULL;
static void version (void) {
fprintf(stderr, _("oggdec from %s %s\n"), PACKAGE, VERSION);
fprintf(stdout, _("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 [options] file1.ogg [file2.ogg ... fileN.ogg]\n\n"));
fprintf(stderr, _("Supported options:\n"));
fprintf(stderr, _(" --quiet, -Q Quiet mode. No console output.\n"));
fprintf(stderr, _(" --help, -h Produce this help message.\n"));
fprintf(stderr, _(" --version, -v Print out version number.\n"));
fprintf(stderr, _(" --bits, -b Bit depth for output (8 and 16 supported)\n"));
fprintf(stderr, _(" --endianness, -e Output endianness for 16-bit output; 0 for\n"
" little endian (default), 1 for big endian.\n"));
fprintf(stderr, _(" --sign, -s Sign for output PCM; 0 for unsigned, 1 for\n"
" signed (default 1).\n"));
fprintf(stderr, _(" --raw, -R Raw (headerless) output.\n"));
fprintf(stderr, _(" --output, -o Output to given filename. May only be used\n"
fprintf(stdout, _(" by the Xiph.Org Foundation (http://www.xiph.org/)\n\n"));
fprintf(stdout, _("Usage: oggdec [options] file1.ogg [file2.ogg ... fileN.ogg]\n\n"));
fprintf(stdout, _("Supported options:\n"));
fprintf(stdout, _(" --quiet, -Q Quiet mode. No console output.\n"));
fprintf(stdout, _(" --help, -h Produce this help message.\n"));
fprintf(stdout, _(" --version, -v Print out version number.\n"));
fprintf(stdout, _(" --bits, -b Bit depth for output (8 and 16 supported)\n"));
fprintf(stdout, _(" --endianness, -e Output endianness for 16-bit output; 0 for\n"
" little endian (default), 1 for big endian.\n"));
fprintf(stdout, _(" --sign, -s Sign for output PCM; 0 for unsigned, 1 for\n"
" signed (default 1).\n"));
fprintf(stdout, _(" --raw, -R Raw (headerless) output.\n"));
fprintf(stdout, _(" --output, -o Output to given filename. May only be used\n"
" if there is only one input file, except in\n"
" raw mode.\n"));
}
static void parse_options(int argc, char **argv)
{
int option_index = 1;
......
......@@ -28,10 +28,6 @@
#include "utf8.h"
#include "i18n.h"
#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 */
struct option long_options[] = {
......@@ -101,7 +97,7 @@ int main(int argc, char **argv)
if(optind >= argc)
{
fprintf(stderr, _("%s%s\nERROR: No input files specified. Use -h for help.\n"), VERSION_STRING, COPYRIGHT);
fprintf(stderr, _("ERROR: No input files specified. Use -h for help.\n"));
return 1;
}
else
......@@ -396,12 +392,10 @@ clear_all:
static void usage(void)
{
fprintf(stdout, _(
"%s%s\n"
"Usage: oggenc [options] inputfile [...]\n"
"\n"), VERSION_STRING, COPYRIGHT);
fprintf(stdout, _(
"OPTIONS:\n"
fprintf(stdout, _("oggenc from %s %s"), PACKAGE, VERSION);
fprintf(stdout, _(" by the Xiph.Org Foundation (http://www.xiph.org/)\n\n"));
fprintf(stdout, _("Usage: oggenc [options] inputfile [...]\n\n"));
fprintf(stdout, _("OPTIONS:\n"
" General:\n"
" -Q, --quiet Produce no output to stderr\n"
" -h, --help Print this help text\n"
......@@ -829,7 +823,7 @@ static void parse_options(int argc, char **argv, oe_options *opt)
opt->rawmode = 1;
break;
case 'v':
fprintf(stdout, VERSION_STRING);
fprintf(stdout, _("oggenc from %s %s\n"), PACKAGE, VERSION);
exit(0);
break;
case 'B':
......
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