shithub: sox

Download patch

ref: 61a6f4ef4710da68fc1331622196a2c6d6f881ad
parent: 7714a2123a4136cd632d66d06938e68a01b01c4c
author: rrt <rrt>
date: Mon Jan 15 19:44:17 EST 2007

Make "building" of play/rec error-free.

Improve documentation of command-line options.

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -41,7 +41,7 @@
 	$(MAKE) -C libgsm
 
 play rec: sox
-	sox > /dev/null 2>&1
+	./sox --help > /dev/null
 	ln -sf .libs/lt-sox rec
 	ln -sf .libs/lt-sox play
 
--- a/src/sox.c
+++ b/src/sox.c
@@ -1593,7 +1593,7 @@
     }
 }
 
-static void usage(char const * message)
+static void usage(char const *message)
 {
   int i;
   const st_effect_t *e;
@@ -1611,7 +1611,7 @@
          "\n"
          "GLOBAL OPTIONS (gopts) (can be specified at any point before the first effect):\n"
          "-h, --help      display version number and usage information\n"
-         "--help-effect=name  display usage of specified effect; use 'all' to display all\n"
+         "--help-effect name  display usage of specified effect; use 'all' to display all\n"
          "--interactive   prompt to overwrite output file\n"
          "-m, --mix       mix multiple input files (instead of concatenating)\n"
          "-M, --merge     merge multiple input files (instead of concatenating)\n"
@@ -1631,13 +1631,13 @@
          "otherwise they are obtained automatically.  Output files will default to the\n"
          "same format options as the input file unless otherwise specified.\n"
          "\n"
-         "-c channels     number of channels in audio data\n"
+         "-c, --channels channels  number of channels in audio data\n"
          "-C compression  compression factor for variably compressing output formats\n"
-         "--comment=text  Specify comment text for the output file\n"
-         "--comment-file=filename  file containing comment text for the output file\n"
-         "--lua-script=filename  file containing script for a `-t lua' format\n"
-         "-r rate         sample rate of audio\n"
-         "-t filetype     file type of audio\n"
+         "--comment text  Specify comment text for the output file\n"
+         "--comment-file filename  file containing comment text for the output file\n"
+         "--lua-script filename  file containing script for a `lua' format\n"
+         "-r, --rate rate  sample rate of audio\n"
+         "-t, --type filetype  file type of audio\n"
          "-x/-N/-X        invert auto-detected endianness/nibble-order/bit-order of data\n"
          "-B/-L           force endian type to big/little\n"
          "-s/-u/-U/-A/    sample encoding: signed/unsigned/u-law/A-law\n"
@@ -1663,7 +1663,11 @@
   }
 
   printf( "\n\neffopts: depends on effect\n");
-  exit(1);
+
+  if (message)
+    exit(1);
+  else
+    exit(0);
 }
 
 static void usage_effect(char *effect)